Author Topic: Noob question about MASM and UI?  (Read 169 times)

dootdoot

  • Regular Member
  • *
  • Posts: 1
Noob question about MASM and UI?
« on: July 03, 2017, 08:49:04 PM »
Keeping it short and simple, I wrote some kind of tetris clone (simpler) in 32 bit MASM. 

I want to know if it would be an easy (for a beginner) job to port this thing over into some kind of UI. Literally just an exe that pops up with a legitimate (non-console based) window.
Hell, we could go super easy mode and just display the console window based version inside of a box. (My console window is resized to a rectangle as is the buffer). 

Is this just a hop into the windows apis and git er done thing? Or do I need to use a library or something?

jj2007

  • Member
  • *****
  • Posts: 7752
  • Assembler is fun ;-)
    • MasmBasic
Re: Noob question about MASM and UI?
« Reply #1 on: July 04, 2017, 03:10:01 AM »
There are templates around for creating a simple window. The trickier part is creating the rectangles and moving them around.

Re libraries... this code displays a rectangle in a window:
Code: [Select]
include \masm32\MasmBasic\Res\MbGui.asm
  MyRect=123
  MakePen BlackPen, RgbCol(100, 0, 0, 0), width 3
  MakeBrush RedBrush, RgbCol(128, 255, 0, 0)
  MakePath MyRect, Rect(96:250)

Event Paint
  GuiDraw MyRect, BlackPen/RedBrush, 50, 36, fix 2000, 1000
GuiEnd

It's a matter of taste :bgrin:
« Last Edit: July 04, 2017, 04:27:11 AM by jj2007 »