The MASM Forum

General => The Campus => Topic started by: dootdoot on July 03, 2017, 08:49:04 PM

Title: Noob question about MASM and UI?
Post by: dootdoot 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?
Title: Re: Noob question about MASM and UI?
Post by: jj2007 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: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: