Hello Guest

Author Topic: Possible to commit a sprite batcher at runtime?  (Read 4013 times)

ilikepopsoda

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 4
    • View Profile
Possible to commit a sprite batcher at runtime?
« on: April 25, 2013, 08:43:48 pm »
To sum it up, I'm making a level generator that will instantiate chunks of the level at a time. Each time a chunk is instantiated, I need to be able to access all of the 2D tiles in the chunk so I can correct for random rotations that are made to the overall chunk.

There are going to be A LOT of tiles being used in the overall level, so I'd like to make use of the sprite batcher. As the batcher commits, though, any scripts on the 2D tiles that make up the level chunk get deleted and thus nullifying the ability to make rotational corrections.

I was thinking it would be great if I could commit the batcher once all the 2D tiles have been modified, but I'm not finding any information on the subject.

Is this just not going to work?

Thanks,
Gerald

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Possible to commit a sprite batcher at runtime?
« Reply #1 on: April 25, 2013, 09:31:08 pm »
No, you can't commit a static sprite batcher at runtime.

The good news is, you can construct a batcher at runtime quite easily. Here is a link on how to go about it.
http://unikronsoftware.com/2dtoolkit/forum/index.php/topic,1064.msg5083.html#msg5083

ilikepopsoda

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Possible to commit a sprite batcher at runtime?
« Reply #2 on: April 25, 2013, 10:01:02 pm »
Awesome! That's good news. I'll give it a go and see how it's done.

Thanks!
Gerald