Could someone please cast their eye over this,
I don't understand why this doesn't draw a green square.
Thanks
GLOBAL single%[]//[15]
GLOBAL w=16,h=16
DIM single%[w*h]
GLOBAL test2%
test2%=GENSPRITE()
FOR y=0 TO h-1
FOR x=0 TO w-1
single[x+(y*w)]=INTEGER(0xff00ff00)
DEBUG "\n"+x+" "+y+" "+HEX$(single[x+(y*w)])
// BREAK
NEXT
NEXT
LOCAL u
test2%=MEM2SPRITE(single%[],test2%,w,h)
IF test2%=0
DEBUG "\ntest2%=0 MEM2SPRITE FAILED"
END
ENDIF
DEBUG "\ntest2%= "+test2%
PRINT test2%,100,80
DRAWSPRITE test2%,100,100
SHOWSCREEN
MOUSEWAIT
change in:
ret%=MEM2SPRITE(single%[],test2%,w,h)
test2%=MEM2SPRITE(single%[],test2%,w,h)
I also think the referencing test2 and using Mem2sprite with test2 id looks like it might cause a problem.
Oh Yeah! :good:
Thanks very much.