Problem with getting character in front of object/background

  • #1, by saintandsimonMonday, 14. October 2013, 22:34 11 years ago
    Yo, I'm having a bit of struggle this night with a particular thing - getting a character in front of an object.

    This screenshot hopefully makes it clear. Basically, I have one dark environment, and when the character activates the blinds in the room, a lighter image/object is set to visibility 100%. Kinda cut in the lighter image and started the game, just to show you how I mean. I'd like the character to not get covered by the lighter object, but in the foreground instead.

    I tried playing around with the "object center" but with no luck. What might I be doing wrong?

    Newbie

    85 Posts


  • #2, by esmeraldaTuesday, 15. October 2013, 09:01 11 years ago
    Hi,
    there is a button to sort the objects according to the object center. You need to press that button (two yellow arrows) else your playing around with the object center will take no effect.

    Key Killer

    513 Posts

  • #3, by AlexTuesday, 15. October 2013, 11:13 11 years ago
    As Esmeralda said, sorting the objects will solve your problem.
    the drawing algorithm explained: the scene objects are drawn according to the list order (object at the bottom is drawn first, then second to last object, and so on). Before drawing an object the object center is compared to the character y-position (vertical position). If the character position is smaller than the object center then the character is drawn. This defines where the character fits in.
    Usually you're fine by using the sort button to sort the objects by object center. Only in rare cases it can happen that you need to change this order.

    Great Poster

    378 Posts

  • #4, by saintandsimonTuesday, 15. October 2013, 11:23 11 years ago
    Thank you both for your answers, really helpful! I'll get to it immediatly. And thank you Alex, for the detailed answer on how it works - ill copy and paste it into my notebook and use as a reference if I forget it again. smile

    Newbie

    85 Posts

  • #5, by BarneyTuesday, 15. October 2013, 13:49 11 years ago
    Since we are speaking of the object order... Any ideas on how to permanently put one character in front of another if they both walk along the same line?

    Newbie

    42 Posts