-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Documentation for overlays and characters Zorder and baseline #210
Comments
Further improvement: This part: could probably improved by a further note:
|
Overall, I think this information about how sorting order works is shared among several kinds of objects. Therefore it's better to put it in a separate article, while adding a link to that article in Overlay.ZOrder, as well as other related ones (like Character.Baseline, Character.y, GUI.ZOrder, and so forth). |
Room overlays, character, objects and walkbehinds are sorted inside the "room" and the GUIs and Overlays are sorted on "top". This new article do we want it only about sorting or we want to include something on the coordinates too? |
Which information about coordinates are you referring to? Regarding article, I think we need a section about engine behavior, as briefly proposed in #209. The article itself may be called simply "Objects draw order" and contain necessary info to understand how objects are sorted among each other. EDIT: the article may be placed under "Engine" for now. The amount of documentation is so low there, that you won't be able to organize it better at the moment. |
baseline == Zorder, it's a number, things are ordered by that number, big numbers are placed forward, small numbers placed backwards. What happens when numbers are the same? That is a mystery, but for GUIs they follow the order of IDs. I have no idea what happens if they are other types of objects or objects of different types mixed together when zorder is the same. Generally in rooms we say baseline and in GUIs we say Zorder. Things in AGS have names for historical reasons, like why is YOffset named Z and things like that.
Overlay and GUI coordinates are native screen coordinates, GUIControls are relative to owning GUIs, these object coordinates reference their top left corner. Characters, Objects, and Room Overlays are in room coordinates, where Camera and Viewports exists, complicated explanation about character feet object is bottom left, transformations, yada yada. You know, it all makes sense but we really need drawings somewhere. Perhaps it's best to leave coordinates to some other article. |
For GUIs they don't follow the order of IDs either in the latest build. This is a strange situation, but the draw sort does not refer to IDs at all, only clicking detection. I'm not sure why it was done so. It's possible this could have changed somewhere, maybe in 3.6.0 when the sorting of Overlays was added. I need to double check that. For room entities (room objects, characters, walk-behinds, room overlays) the order of 2 elements with equal zorder is currently undefined.
Now when you mention this, sprite anchoring relative to the object position may belong to the same article. This may eventually be a big article that explains how sprites are drawn on screen, where sorting is a sub-section. |
By the way: I think the fact that "player.Baseline = 0" means "automatically set baseline to lowest edge of player" is quite misleading ("is current baseline value 0 or something else?"); maybe it would be better if in 3.6.0 a "baseline flag" is added, something like "player.baselineAuto = true/false"; if set to "true", writing to player.Baseline should cause an error, being it managed by engine, and player.Basline should always contain the Baseline value iternally seen/used by the engine. It's an issue similar to sprite slot 0 automatically assigned by the engine: the engine should never decide on its own to overwrite variables set by developer (IMHO), but only act on "reserved" variables, which should appear as readonly to developer. |
We are not adding anything new to 3.6.0 now, the version is close to the stable release. So this has to be left for the future consideration. |
I think the documentation about this new ZOrder feature introduced with 3.6.0 could be more clear by adding a reference to characters and objects baseline.
Current description:
Suggested changes (in bold):
The text was updated successfully, but these errors were encountered: