2D Toolkit Forum

2D Toolkit => Support => Topic started by: lofl on June 06, 2013, 07:34:19 pm

Title: Is there how to create sprites from same texture dynamically?
Post by: lofl on June 06, 2013, 07:34:19 pm
I create sprite dynamically using CreateFromTexture.
And I want to create some more sprite from that texture.

Simply I copy code CreateFromTexture, one more spritecollection is created.
But I want to reuse texture.
Title: Re: Is there how to create sprites from same texture dynamically?
Post by: unikronsoftware on June 06, 2013, 09:37:16 pm
Create a sprite collection at runtime.
Use tk2dSpriteCollectionData.CreateFromTexture to create it.

Then create a sprite, and SetSprite( ... )
Title: Re: Is there how to create sprites from same texture dynamically?
Post by: lofl on June 10, 2013, 03:28:17 am
I did it!

Thanks!!