Page 1 of 1
LuaRendering:bring_to_front()
Posted: Wed Nov 20, 2019 3:02 am
by raiguard
![tapeline draw order.gif](./download/file.php?id=55189)
- tapeline draw order.gif (246.87 KiB) Viewed 1128 times
In the above GIF, you can see that the green lines are being blocked by the grey lines. This is happening because the grey lines are being created/destroyed dynamically as the tape is drawn, so they're created after the green lines. Therefore, they cover the green lines. Additionally, all of the lines overlap the border, because the border was created at the beginning and is just getting its size updated.
So, I request a way to manipulate draw order. Because draw order is such a complicated problem, I boiled it down to one thing:
rendering.bring_to_front(id). When this function is called, the object is brought to the front of the line, so it is drawn over everything else as if it was just created.
When the tapeline changes size, I could call this function on the green lines, then the border, so the draw order works out like its supposed to.
Thanks!
Re: LuaRendering:bring_to_front()
Posted: Thu Nov 21, 2019 4:42 pm
by Bilka
Okay, added for the next version. Keep in mind that objects with a limited lifetime are always drawn on top of objects with an unlimited lifetime.
Re: LuaRendering:bring_to_front()
Posted: Thu Nov 21, 2019 10:39 pm
by raiguard
\o/ Thank you, much appreciated!