LuaRendering:bring_to_front()

Post Reply
User avatar
raiguard
Factorio Staff
Factorio Staff
Posts: 449
Joined: Wed Dec 13, 2017 8:29 pm
Contact:

LuaRendering:bring_to_front()

Post by raiguard »

tapeline draw order.gif
tapeline draw order.gif (246.87 KiB) Viewed 952 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!
Don't forget, you're here forever.

Bilka
Factorio Staff
Factorio Staff
Posts: 3123
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: LuaRendering:bring_to_front()

Post 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.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.

User avatar
raiguard
Factorio Staff
Factorio Staff
Posts: 449
Joined: Wed Dec 13, 2017 8:29 pm
Contact:

Re: LuaRendering:bring_to_front()

Post by raiguard »

\o/ Thank you, much appreciated!
Don't forget, you're here forever.

Post Reply

Return to “Implemented mod requests”