Canvas trouble

Blitz3D Forums/Blitz3D Beginners Area/Canvas trouble

Angel(Posted 2003) [#1]
Hey there...

I'm having trouble getting the canvas commands to work in BlitzPlus...

Could someone please show me an example of using CreateCanvas, and then drawing upon it and rendering it?

Thanks.


Kevin_(Posted 2003) [#2]
; Try looking at the example code in the samples folder
; for a more detailed explanation.
; Below is a simple example. Regards, Prof

WinWidth=400:WinHeight=390
WinTitle$="Window"
WinX=(ClientWidth(Desktop())-WinWidth)/2
WinY=(ClientHeight(Desktop())-WinHeight)/2
Window=CreateWindow(WinTitle$,WinX,WInY,WinWidth,WinHeight,0,3)

;Create a canvas for the whole window area.
MainCanvas=CreateCanvas(0,0,ClientWidth(window),ClientHeight(window),window)
SetGadgetLayout Maincanvas,1,1,1,1
SetBuffer CanvasBuffer(MainCanvas)

; Now draw what-ever you want
Text 10,10,"Simple canvas setup."


While WaitEvent()<>$803


Wend
End