News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Noob question about MASM and UI?

Started by dootdoot, July 03, 2017, 08:49:04 PM

Previous topic - Next topic

dootdoot

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

#1
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: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: