Sure! You can draw something to a PixelDisplay (like gfx
), and then pluck that drawing out as an image with getImage
. Here's an example:
clear
gfx.line 0,0, 100,50
gfx.line 0,50, 100,0
sp = new Sprite
sp.image = gfx.getImage(0, 0, 100, 50)
display(4).sprites.push sp
sp.x = 480
while true
sp.y = 360 + 100 * sin(time)
yield
end while
This draws an "X" on the gfx
display, then creates a sprite out of it and animates that sprite in the loop.
Does this answer your question?