Hello Guest

Author Topic: Tiling an image  (Read 4534 times)

markgrin

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 3
    • View Profile
Tiling an image
« on: November 19, 2012, 02:59:25 am »
I'd like to take a texture, either from a collection or not, and have it repeat in x or y or both dimensions over an area.  I found this thread...

http://unikronsoftware.com/2dtoolkit/forum/index.php/topic,846.msg4068.html#msg4068

...which seems to indicate you can use a tk2dsprite without a SpriteCollection, but I don't see how to do that. 

Advice?

Thanks!



unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Tiling an image
« Reply #1 on: November 19, 2012, 09:41:50 am »
If you're not using an atlas, why would you need a tk2dSprite?

(And yes, you can create one without an atlas, but only from script. Use this:
http://unikronsoftware.com/2dtoolkit/doc/html/classtk2d_sprite.html#adab98009ebf070997ced21134492e536)

If you want to repeat a texture, why not create sprites at the correct points, put them in a static sprite batcher, and commit?