Object center/Draw order

  • #1, by franja-langerSaturday, 31. October, 13:58 3 weeks ago
    Hello everyone,

    I have some problems with the engine‘s draw order.
    For example, one of my characters is sitting at a table. I want him to lean on his elbow, so his arms have to be drawn in front of the table, while the torso is still behind it.
    I am animating in spine, so I do have several layers of images, but in Visionaire he can either stand in front or behind my table.
    Is there any solution or do I have to cut my characters body, so that he can be in front of the table only?

    Thank you very much

    Newbie

    4 Posts


  • #2, by esmeraldaSunday, 01. November, 12:12 3 weeks ago
    Sadly, there is only in front or behind an object.

    What I do in these cases is
    - split up the object in several images with different object centers    or
    - create two images of the object, one with a hole where the part of the character should be visible, make two objects of it and change objects when needed   or
    - make the object part of the characters image (and change outfits) (or like you have in mind, cut the character)

    depending what works best / is easiest in each case

    Great Poster

    396 Posts

  • #3, by franja-langerMonday, 02. November, 17:08 3 weeks ago
    Thank you very much for your reply, esmeralda!

    I think I can handle it now, but there is another problem I am still not able to fix.

    I have two characters, C1 and C2.
    C1 is sitting on a chair. C2 stands close to him, so that the chairs seating needs to be drawn in front and the chairs back behind him. For that reason I seperated the chair in two images.
    The draw order now is: back, C2, seating, C1.
    Up to now it's fine, but I created an animation for C2, that makes him whisper something in C1's ear. Unfortunately his arm has to be in front of C1, which is impossible, since any object has only one center.

    Newbie

    4 Posts

  • #4, by esmeraldaMonday, 02. November, 20:56 3 weeks ago
    Oh sorry, no idea what to do here.

    You could  change the object center of this one animation to a higher y value and when playing the animation you change the position of the character to a higher y value (so the characters sprite stays in the same place), so C2 is now (completely) in front of C1. (Much hussle for an imperfect result, C2 will be also in front of the seat) And change back to the former positon after the animation.

    Not sure if it is possible to change the object center via lua during an animation. I don't think so...

    I can only recommend to have the limitations of the draw order in mind when planning the scenes.

    Great Poster

    396 Posts

Write post