Hello Guest

Author Topic: How to set draw/render layer of sprites?  (Read 4312 times)

Velvety

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 19
    • View Profile
    • Velvety Couch Games
How to set draw/render layer of sprites?
« on: August 18, 2013, 11:26:29 pm »
Hi,

I've recently started using 2DToolkit.  I am converting an older code base of mine that used Sprite Manager 2.  I'm trying to figure out how to render sprites ontop/behind each other with 2DToolkit without manually setting the z position of the sprite transforms.  SM2 had a "drawlayer" property to handle this on its sprites.  I see in your script reference that the tk2dSprite class is supposed to have a RenderLayer property that sounds like it would do the same thing.  However, this property does not actually exist in that class when I look.  How come it is missing?  Is there some other way to handle the order that sprites are rendered in?

Thanks, really liking 2DToolkit so far.
« Last Edit: August 18, 2013, 11:28:08 pm by Velvety »

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: How to set draw/render layer of sprites?
« Reply #1 on: August 18, 2013, 11:40:21 pm »
The RenderLayer property is only in 2D Toolkit 2.2 beta - you must've seen the RenderLayer property there? You can get beta 1 from the forum.

Velvety

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 19
    • View Profile
    • Velvety Couch Games
Re: How to set draw/render layer of sprites?
« Reply #2 on: August 19, 2013, 12:33:38 am »
Ah that makes sense.  I have been reading the v2.2 documentation here (http://www.unikronsoftware.com/2dtoolkit/docs/2.20/html/classtk2d_sprite.html) because I just bought 2DToolkit and assumed it was the most recent one in the docs (I actually have v2.1).

I will checkout the v2.2 beta now, thanks!

Are there any known issues with the beta?


unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: How to set draw/render layer of sprites?
« Reply #3 on: August 19, 2013, 09:59:57 am »
I'm not aware of any major issues. The beta adds new features, and fixes some bugs in older ones so its probably safe to use.