1. Hey! Guest! The 35th GMC Jam will take place between November 28th, 12:00 UTC - December 2nd, 12:00 UTC. Why not join in! Click here to find out more!
    Dismiss Notice

Question - Code Recent depth changes?

Discussion in 'GameMaker Studio 2 Community Tech Support' started by Kyrieru, Nov 4, 2019.

  1. Kyrieru

    Kyrieru Member

    Joined:
    Jul 24, 2017
    Posts:
    71
    After a recent GMS2 update, draw GUI stopped working for a specific object. After a while I realized it was due to me using;

    depth = -1000000

    It does not draw anything in the GUI event.

    Ignoring the original reason for it, a depth of -1 does not have this effect. Obviously this is not much of a problem, but what caused that to happen in the recent updates?
     
  2. Nocturne

    Nocturne Friendly Tyrant Forum Staff Admin

    Joined:
    Apr 13, 2016
    Posts:
    6,977
    This is something that is explained clearly in the manual on the page about layer depth, but appears to be missing from the page on the depth variable (I'll get it added)...

    https://docs2.yoyogames.com/index.html?page=source/_build/3_scripting/4_gml_reference/instances/instance_variables/depth.html

    Note that you can actually work around this by using "layer_force_draw_depth": https://docs2.yoyogames.com/index.h...ence/rooms/layers/layer_force_draw_depth.html
     
  3. Hyomoto

    Hyomoto Member

    Joined:
    Jul 7, 2016
    Posts:
    1,078
    The question was already answered but I smell a strange behavior here. If you are using the draw GUI event, you are already drawing on top of the entire draw pipeline, and you still have begin, normal and end events. It seems like -100000 is being chosen here rather arbitrarily, though if it isn't I would suggest reading about new depth ordering paradigms in GML as the old depth methods from GMS1 and prior are not great options.

    https://forum.yoyogames.com/index.p...ested-list-grid-binary-list.13425/#post-88283
     
  4. Kyrieru

    Kyrieru Member

    Joined:
    Jul 24, 2017
    Posts:
    71
    Yeah, wasn't too worried about using-1000000 was just an arbitrary number I used. Good to know it's just a hard limit doing it.

    Though what I don't get is why it didn't happen before, if it was already in the manual.
     
  5. Yal

    Yal GMC Memer GMC Elder

    Joined:
    Jun 20, 2016
    Posts:
    3,868
    Is the -16000 / 16000 range enforced or warned about somehow when importing a legacy project, or is the only way to know if there's bugs caused by this to check every object's default depth?
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice