Hello Guest

Author Topic: single SpriteCollections to store each big images?  (Read 3337 times)

graphic_dude

  • Newbie
  • *
  • Posts: 2
    • View Profile
single SpriteCollections to store each big images?
« 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 :)
« Last Edit: March 20, 2013, 02:42:59 pm by graphic_dude »

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: single SpriteCollections to store each big images?
« Reply #1 on: March 20, 2013, 02:57:41 pm »
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.


graphic_dude

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: single SpriteCollections to store each big images?
« Reply #2 on: March 20, 2013, 03:00:43 pm »
Thank you very much for the quick & precise answer !!!!! :)