Can you mix GUI code with 2D code?

Blitz3D Forums/Blitz3D Beginners Area/Can you mix GUI code with 2D code?

BachFire(Posted 2003) [#1]
Like fx. can you do some 2D code, and make that run in a canvas? Or how would you go about it?

I needed to make a vertical line in a Win32 App, but didn't know how to do it. How?


assari(Posted 2003) [#2]
You mean something like this?
Global window=CreateWindow("Canvas Painter",10,10,400,400,0)
Global canvas=CreateCanvas(2,2,400,400,window)

SetBuffer CanvasBuffer(canvas)
Line 20,20,20,300 ;vertical line

Color 210,250,250
Oval 50,50,100,200,1 

FlipCanvas canvas

Repeat
 WaitEvent()
Until EventID()=$803 

End



BachFire(Posted 2003) [#3]
Yes, exactly! Thanks for your help! ;)