Whats wrong with this code?
BlitzPlus Forums/BlitzPlus Programming/Whats wrong with this code?
| ||
Im new to canvas dunno what i did wrongwindow = CreateWindow("Woot My Game", 10, 30, 640, 480 ) canvas = CreateCanvas(0, 0, ClientWidth(window), ClientHeight(window), window ) SetGadgetLayout canvas, 1, 1, 1, 1 cls Global Image Image = LoadImage("ship3.gif") SetBuffer CanvasBuffer(canvas) DrawImage Image, 0, 0 flip Repeat event = WaitEvent (1) Until event = $803 |
| ||
Hehe, had to restart my PC to get Blitz+ working again. Maybe you've coded the first anti-blitz virus ;P Anyway this should work, window=CreateWindow( "Window",10,30,640,480,window,15) canvas=CreateCanvas( 0,0,ClientWidth(window),ClientHeight(window),window ) SetGadgetLayout canvas, 1, 1, 1, 1 ship=LoadImage("ship.gif") SetBuffer CanvasBuffer(canvas) timer=CreateTimer(60) ;for 60 FPS While WaitEvent() Select EventID() Case $803 End Case $4001 ;main() ** HERE YOU PUT YOUR MAIN LOOP ** Cls DrawImage ship,300,200 FlipCanvas canvas End Select Wend |
| ||
it doesnt work :( |
| ||
What do you mean? Hmmm Change "ship.gif" for "ship3.gif" |
| ||
lol i figured it out GIF dont work with blitz+ so I fixed it, and it works perfectly |