Cache scene object
OkieDokie

Hello again

 

Sometimes I use Sprite.cache() that is great to boost performance when my sprite has some vector draw function.

 

Now I have an object that is made from many (up to 16) different sprites. I hoped to find a SceneObject.cache() function that could combine them into one single Sprite, but it is not there :(

 

Is it possible to add something like this to Wade?

 

Thank you

1 Comment
foxcode

Hi OkieDokie

 

I think what you might be looking for is sprite drawToImage(virtualPath, replace, offset, transform, compositeOperation)

 

The problem with this approach is if you want to move a sprite individually, you would have to recreate the whole image.

Using draw to image you could do this

 

var sprite1 = new Sprite("myImg.png");

var sprite2 = new Sprite("cuteCat.png");

 

sprite1.drawToImage("myCoolSprite");

sprite2.drawToImage("myCoolSprite");

 

var sprite3 = new Sprite("myCoolSprite");

 

 

I hope this makes sense, though it may not be what you are looking for.

Post a reply
Add Attachment
Submit Reply
Login to Reply