08-20-2017, 06:28 PM
|
#55
|
Human being with feelings
Join Date: Feb 2017
Posts: 4,820
|
Quote:
Originally Posted by Lokasenna
GUI.elms_list exists solely to keep track of which z-layer each element is on so they can be updated/redrawn in the correct order. Have a look at GUI.update_elms_list in Core.lua - it runs on every update loop:
- For every element in GUI.elms...
---- If z = -1, delete it from the table.
---- Otherwise, add it to the appropriate subset of the z table
---- If the script is still starting up, call the element's :init method - this is where the stock classes get their blitting buffers, etc
- Fill in the table with any empty z-layers so we can use ipairs() on it, and note the highest value - the script needs to know this when it's updating/drawing elements so it has end/start points, respectively.
The table is being printed out the way you see because (I think) of Lua handles table indexes - 1 is the default start point, so any contiguous values starting from there don't need to be explicitly stated. [0] and [333] are outside that pattern, so they need to be named.
|
ohh ok i see.never mind then! sorry I thought it was something interesting. Thank you for taking the time !
good music
|
|
|