2D Toolkit Forum
2D Toolkit => Support => Topic started by: graphic_dude on March 20, 2013, 02:31:42 pm
-
Hi,
for my game, I have many background images (.png) whose dimensions are 1280x800, and these images are NOT tile-based (artworks with no repeating patterns).
So, I would like to know if I have to create a single 2DTK's SpriteCollection for each of those (big) images, or is it possible to deal with only one SpriteCollection (coding (C#) some kind of image loading process while game is running / and if possible, is there any constraint about images' location/pathdir)?
(because if my game has 100 different screens, creating 100 sprite collections seems to be a little bit overkill, doesn't it?)
Thank you for any piece of advice :)
-
You can always just use runtime sprite collections, load your png in and create a sprite directly using tk2dSprite.CreateFromTexture. (http://unikronsoftware.com/2dtoolkit/doc/html/classtk2d_sprite.html#adab98009ebf070997ced21134492e536)
That way you won't need to put them into collections, and also you can keep them as pngs (rename to .png.bytes, and use Texture2D.LoadImage).
Keep them in a resources directory, and you will be able to load by name.
-
Thank you very much for the quick & precise answer !!!!! :)