Bug Issue: Unspecified Text Draw Order for actor attached to screen


Pages: 1

Fool

  • Level 1 Stencyler
April 27, 2016, 10:13:06 pm
Text render order is ill-defined, or otherwise ignores layer order when drawn from a behavior thats part of an actor attached to the hud.
How to reliably recreate:
0. Create a new map
1. Create 3 layers.
2. Create an actor, lets call it 'inventory'
3. Place an instance of 'inventory' manually on the first layer of the map
4. Create a sprite as tall as your test screen, make it pure black, and 2 tiles wide.
5. Create a new actor 'invBackground', set the newly created sprite as the actors animation
6. Create an actor, lets call it 'knife'
7. In knife, create an attribute called 'isHovered'
8. Add two new events to 'knife'. 'onEnter' and 'onExit' via onClick.
9. In 'onEnter' set 'isHovered' to true
10. In 'onExit' set 'isHovered' to false
11. Attach a draw event to 'knife'
12. You may use any font or color you like, this step is irrelevant
13. In the draw event of 'knife', add an 'if' with 'isHovered' as the condition
14. In the 'if' block, draw any text, but make it long enough that it would be wider than the sprite for the other actor, invBackground
15. Manually place a copy of invBackground in the second layer of the map.
16. In invBackgrounds creation event, hide the second layer
17. Add an 'onClick' event to inventory, and in it, show the second layer
18. In inventorys 'onClick' event, spawn an instance of 'knife' at 0, 0 on the third layer
20. add 'anchor to screen'  in creation code of inventory, invBackground, & knife 
21.  Run your demo.
22. Click on inventory in game
23. Hover over the knife instance
24. Observe how the overlay text draws beneath invBackground, even though the instance of knife doing the drawing, is on a higher layer. Text should be cut off by the animation of invBackground.
« Last Edit: April 27, 2016, 10:13:49 pm by Fool »


Issue updated by Fool - April 27, 2016, 10:13:49 pm
  • Issue renamed from "Unspecified Draw Order for Text for actor attached to screen" to "Unspecified Text Draw Order for actor attached to screen"


letmethink

  • Master Stencyler
  • *
April 27, 2016, 10:51:58 pm
Anchor to screen raises the actor to the top layer as they are drawn over everything else.


Fool

  • Level 1 Stencyler
April 28, 2016, 04:38:11 am
So what determines the draw order of multiple actors that are all anchored? What gets drawn first?


letmethink

  • Master Stencyler
  • *
April 28, 2016, 08:06:12 am
I think it is order of actor creation, but not anything specific. Perhaps it is order of being anchored (so ones that are anchored first will draw lowest).


Fool

  • Level 1 Stencyler
April 28, 2016, 09:56:42 pm
I wish that were true. If it were then the text would draw on top like it is supposed to be.
At this point though it may well be that I'm not grasping something essential.


rob1221

  • Master Stencyler
  • *
June 03, 2018, 10:55:35 am
I'm not seeing any issues here in 3.5.  Text of anchored actors is drawn above the actors, and the z-order of the anchored actors depends on the order they were anchored in with the later actors appearing above earlier actors.
  • Status changed from New to Closed


Pages: 1

Details

  • Reported
    April 27, 2016, 10:13:06 pm
  • Updated
    June 03, 2018, 10:55:35 am

  • View Status
    Public
  • Type
    Bug
  • Status
    Closed
  • Priority
    Normal
  • Version
    3.4.0 beta2
  • Fixed in
    (none)
  • Assigned to
    (none)
  • Category
    Engine

Tags