before anything, I'm using 1.16, 1.18 refuses to work here.
Anyway:
That example from Hamish is actually the good-case-scenario.
I think most ppl use viewport to fill-up the gap left by the lack of DrawImageRect (the proper one, not the one in bmax), for which we need a viewport and negative x/y coords for the image to draw.
Try this stuff, and notice the different x/y coords at the draw-/tileimage commands!
Anyway:
That example from Hamish is actually the good-case-scenario.
I think most ppl use viewport to fill-up the gap left by the lack of DrawImageRect (the proper one, not the one in bmax), for which we need a viewport and negative x/y coords for the image to draw.
Try this stuff, and notice the different x/y coords at the draw-/tileimage commands!
SuperStrict Local window:TGadget=CreateWindow("o.O",32,32,640,480) Global canvas:TGadget=CreateCanvas(32,32,256,256,window) Global image:TImage=CreateImage(64,64) Local x:Int Local y:Int Local i:Int Local pm:TPixmap=LockImage(image) For y=0 To 63 For x=0 To 63 i=Rnd(255)-(x*2)-(y*2) If i<0 i=0 WritePixel pm,x,y,$ff000000|i+256*(255-i)+65536*i Next Next UnlockImage image SetGraphics CanvasGraphics(canvas) Repeat WaitEvent() If EventID()=EVENT_WINDOWCLOSE End If EventSource()=canvas update Forever Function update() SetViewport 0,0,256,256 Cls SetViewport EventX(),EventY(),32,32 ' try em all! (but just one at a time eh!) ' ' ' works! TileImage image,EventX(),EventY() ' works! ' DrawImage image,EventX(),EventY() ' you GOTTA *love* this effect ^_^ ' TileImage image,0,0 ' also buggy ' DrawImage image,0,0 Flip End Function