Hello Guest

Author Topic: Create Sprite collection on runtime  (Read 3595 times)

prodyminds

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 9
    • View Profile
Create Sprite collection on runtime
« on: August 20, 2013, 06:48:26 pm »
Hi, i'm in a little project and i want to create a news menu, where i can load using www images and texts. My idea is to have a small image, like 100px x 100px and description or something like that, and make it a button to open browser for more information.

But the problem i face is creating the Sprite collection to show the image on runtime. It this possible with tk2D?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Create Sprite collection on runtime
« Reply #1 on: August 20, 2013, 06:52:36 pm »
You can create a sprite at runtime using tk2dSprite.CreateFromTexture, or if you want something more powerful, you can extract parts of an image using tk2dSpriteCollectionData.CreateFromTexture. You can see examples of how to do this in sample #13 - runtime sprite collections.

prodyminds

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Create Sprite collection on runtime
« Reply #2 on: August 20, 2013, 07:18:30 pm »
wow, thanks a lot.

It was pretty easy.

You make a fantastic work with tk2D.