Hello Guest

Author Topic: How can I repeat texture on sprite several times?  (Read 8803 times)

spry

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 2
    • View Profile
How can I repeat texture on sprite several times?
« on: March 22, 2012, 06:35:54 pm »
I have wave tile, that is intended to be repeated 10 times in horizontal direction. How can I set this repeating instead of placing 10 sprites in sprite batcher?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: How can I repeat texture on sprite several times?
« Reply #1 on: March 22, 2012, 07:29:28 pm »
You can't at the moment. I've got a half written tiling sprite code (with 9 slice edges), but I haven't got around to actually completing it yet. If you'd like to actually go ahead and implement it, I'll be happy to share the code I've got so far with you.

fsadeq

  • 2D Toolkit
  • Sr. Member
  • *
  • Posts: 353
    • View Profile
Re: How can I repeat texture on sprite several times?
« Reply #2 on: March 23, 2012, 02:46:36 am »
Is this any different/better than just using the new Tile Editor?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: How can I repeat texture on sprite several times?
« Reply #3 on: March 23, 2012, 08:39:29 am »
More or less. Think of it as a SlicedSprite, but the middle bit tiles instead of scales.

tommyv

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: How can I repeat texture on sprite several times?
« Reply #4 on: July 30, 2012, 08:33:49 pm »
Any word on this tiling capability?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: How can I repeat texture on sprite several times?
« Reply #5 on: July 30, 2012, 09:50:50 pm »
The tiling sprite isn't ready yet, but there are examples of tiling by other means (building a static sprite batcher and using shader clipping), etc. Check out the barbers pole sample here:
http://unikronsoftware.com/2dtoolkit/forum/index.php/topic,398.0.html
(Its in the private support area, so you'll need to register to get access).

You can get pretty much anything you need by using a combination of that and static sprite batchers.

camelot10

  • Newbie
  • *
  • Posts: 24
    • View Profile
Re: How can I repeat texture on sprite several times?
« Reply #6 on: July 31, 2012, 04:26:39 pm »
i have map with roads and paths.
alot of roads and paths.
should i create sprite batcher for every road part?
or real tiling will be done soon?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: How can I repeat texture on sprite several times?
« Reply #7 on: July 31, 2012, 05:01:35 pm »
If you need to do that, why don't you use the Tilemap editor? Is that not suitable?

camelot10

  • Newbie
  • *
  • Posts: 24
    • View Profile
Re: How can I repeat texture on sprite several times?
« Reply #8 on: August 02, 2012, 11:46:45 am »
thats what i need

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: How can I repeat texture on sprite several times?
« Reply #9 on: August 02, 2012, 05:49:29 pm »
The static sprite batcher will be your best bet. It will let you rotate the sprites, and tile them or indeed do what you like with them.

subliminalman

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: How can I repeat texture on sprite several times?
« Reply #10 on: February 07, 2013, 05:18:00 am »
Hi all,

I know this is old but is there any word on tiling? We're looking to do tiling for our game since we don't follow the grid like nature of the TileMap but would like to place our object and scale it without stretching.

Also I wasn't able to get to the link provided above so I was not able to try that out.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: How can I repeat texture on sprite several times?
« Reply #11 on: February 07, 2013, 07:15:16 pm »
There isn't a standalone component that does this in 2D Toolkit, but you can still do it in a number of different ways.

About that link - you will need to register your copy as described http://unikronsoftware.com/2dtoolkit/forum/index.php?index.php/topic,34.0.html to download it, it is in the registered users support section.