2D Toolkit Forum

2D Toolkit => Support => Topic started by: markgrin on November 19, 2012, 02:59:25 am

Title: Tiling an image
Post by: markgrin 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 (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!


Title: Re: Tiling an image
Post by: unikronsoftware 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?