1) get the sprite image
I use the sprites in lots of my 2d softwares (free and opensource for most of them )
In animatoon, my 2d painting application, I can use layers, with a very big size (3500x3000pixels for example).
So, my sprites are 3500x3000 pixels.
I draw the images of the selected tool (brush for example) directly on the current sprite-layer And on the current image-layer.
Do you know if we can get the image of the sprite, like we can with canvas ?
With a canvas :
Code: Select all
Image = getgadgetattribute(#canvas, #PB_Canvas_Image)
I have though about :
Code: Select all
Savesprite(#sprite, filename$)
Loadimage(#imagefromsprite, filename$)
Another technic could be to use drawingbuffer. But with a big image, it seems very long too.
So I have though about copymemory(), but I dont know if its possible, and I don't know how to do that ^^.
If you have any suggestions or idea, it will be great !
2) move sprite uv
Its easy to move sprite uv, with clipsprite(). But, the sprite need to be at the same size as the image.
For an image of 3500x3000pixels, my app animatoon needs lots of memory (ram), because all my layer are composed with :
- a 3500x3000 image (32 bit, with alpha chanel)
- a 3500x3000 sprite for drawing and rendering, with its "own" image (its the image I would like to get)
So, I have though about this technic : to draw partially the image on the sprite of 1000x1000, and move the image on the sprite when needed (move the area to draw for example).
But, its not possible with clisprite(). We cant move an image of 3500x3000 on a sprite in 1000x1000.
So do you know if its possible, to move an image (like for scrolling) of 3500x3000 on a 1000x1000 sprite and how ?
I have try to redraw with startdrawing() the image on the sprite, but it's lagging if I do that at every frame (when moving the canvas area for example)
Thanks.
3) repeat the image on the sprite.
If i have an image with 256x256, iI can repeat it on a sprite of 1024x1024 with :
Code: Select all
StartDrawing (spriteoutput(#sprite))
For i=0 to 3
For j=0 to 3
DrawalphaImage(ImageId(#image), i*256, j*256)
Next
Next
StopDrawing()
I use this technic to the "paper background".
Do you know if there is another technic faster ?
Thank you a lot for your answers .
Ps : sorry for errors, I post from my tablet ^^