Hello Guest

Author Topic: Static Sprite Batcher - my objects... disappeared!  (Read 6212 times)

saeromm

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 5
    • View Profile
Static Sprite Batcher - my objects... disappeared!
« on: July 25, 2012, 08:52:32 am »
When I use 'Static Sprite Batcher', sometimes my objects disappeared....!
I can't explain in English well...
look at this, plz.


1. Edit Mode

Walls(Static Sprite Batcher)
    tree(Sprite)
    tree(Sprite)
    tree(Sprite)
    Game Object(It has only collider component)


2. Pressed Commit Button

Wall(Static Sprite Batcher)



3. Edit Mode(Pressed Edit Button)

Walls(Static Sprite Batcher)
    tree(Sprite)
    tree(Sprite)
    tree(Sprite)
    Game Object(It has only collider component) <- disappeared!




When I used '1.7 final + patch2' version, Static Sprite Batch was good. Objects dosen't disappeared.
Now, my Tk2d version is '1.75'.

*I'm Korean, so I know only easy words and sentence..... sry..





unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Static Sprite Batcher - my objects... disappeared!
« Reply #1 on: July 25, 2012, 06:22:18 pm »
Any GameObjects without sprites would be removed from even the older versions.

The static sprite batcher doesn't batch any objects which aren't sprites and the collider on the game object would definitely not worked on older versions.

Did you add the GameObject recently (after updating)?


saeromm

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Static Sprite Batcher - my objects... disappeared!
« Reply #2 on: July 26, 2012, 08:44:06 am »
No, I didn't.
I used to added a object(without sprite) into static sprite batcher object(1.7 final + patch2 version).


'1.7 final + patch2 version' was no problem.
look at this plz..... this example is '1.7 final + patch2 version.

1. Edit Mode

Walls(Static Sprite Batcher)
    tree(Sprite)
    tree(Sprite)
    tree(Sprite)
    Game Object(It has only collider component)


2. Pressed Commit Button

Wall(Static Sprite Batcher)
    Game Object(It has only collider component)


3. Edit Mode(Pressed Edit Button)

Walls(Static Sprite Batcher)
    tree(Sprite)
    tree(Sprite)
    tree(Sprite)
    Game Object(It has only collider component) <- didn't disappeared!

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Static Sprite Batcher - my objects... disappeared!
« Reply #3 on: July 26, 2012, 10:20:08 am »
Hi saeromm,

This is expected behaviour in this current version, as with the current version you can build hierarchies of objects. I'll see if there is a way around it.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Static Sprite Batcher - my objects... disappeared!
« Reply #4 on: July 26, 2012, 12:54:57 pm »
Hi saeromm,
I think the best thing to do here is to create an object parent, and create your static sprite batcher and gameobject as a child, as the alternatives would mean a lot more runtime complexity.

I'll explain the change which has made this break. In previous versions
SpriteBatcher
   Sprite1
   Sprite2
   Sprite3
   GameObject
     Sprite4
etc. would work, as the gameObject would simply be left, but Sprite4 wouldn't be merged properly.

You can build complex hierarchies now, paving the way for a "Dynamic sprite batcher" in the future.

In the current version, this will work correctly. However, any components attached to GameObject would be lost, as it tries to remember the hierarchy, and will need to remember all other components too.

I suggest doing this if possible.

ParentGameObject
   StaticSpriteBatcher
       Sprite
       Sprite
       Sprite
   GameObject (with collider)

If not it will be possible to make a mashup version which will work as it used to. Let me know if you'd like to do that and I can offer some advice on that.


saeromm

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Static Sprite Batcher - my objects... disappeared!
« Reply #5 on: July 26, 2012, 03:27:39 pm »
thank you for your reply!
I'll try that!