Hello
Guest
Home
Help
Search
Login
Register
2D Toolkit Forum
»
2D Toolkit
»
Support
»
Is there how to create sprites from same texture dynamically?
« previous
next »
Print
Pages: [
1
]
Author
Topic: Is there how to create sprites from same texture dynamically? (Read 3948 times)
lofl
2D Toolkit
Newbie
Posts: 12
Is there how to create sprites from same texture dynamically?
«
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.
Logged
unikronsoftware
Administrator
Hero Member
Posts: 9709
Re: Is there how to create sprites from same texture dynamically?
«
Reply #1 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( ... )
Logged
lofl
2D Toolkit
Newbie
Posts: 12
Re: Is there how to create sprites from same texture dynamically?
«
Reply #2 on:
June 10, 2013, 03:28:17 am »
I did it!
Thanks!!
Logged
Print
Pages: [
1
]
« previous
next »
2D Toolkit Forum
»
2D Toolkit
»
Support
»
Is there how to create sprites from same texture dynamically?