Hi!
I have to do something slightly complicated (involving many, many nodes) and want to check I am doing it okay.
My game’s levels are stored as tables, which generate 6* grids. Each entry in the grid either generates an empty space, or a tile that you can walk on.
I’m making a level select screen, where the player click on buttons to be taken to levels. Each button is shaped like a miniature map of the level it represents, to give a player an idea of which level he is going to play (they kind of look like small letters of an alien alphabet). I’m doing this using GUI scripts.
So, there will be around 200 levels, there is one mini-map for each level, and each mini-map is made of a maximum of 64 nodes. If the player clicks on a node which is part of the mini-map of level one, the player is taken to level one. In total, there are likely to be around 7,500 nodes (generated dynamically. They will only increase in scale on mouse_over and get on_input stuff. That’s not too bad, right?)
So… I’m going to create a table called “levelselectbuttons” where each entry is a table with the individual nodes for each level.
Here’s me generating each node:
local roll = gui.new_box_node(new_position, new_size)
table.insert (self.levselbut[levelno], roll)
pprinting “self.levselbut” prints this:
{ --[[0x11d7a0da0]]
1 = { --[[0x11d7b6d40]]
1 = box@(130, 170, 0),
2 = box@(130, 180, 0),
3 = box@(130, 190, 0),
… etc …
30 = box@(170, 220, 0),
31 = box@(180, 170, 0),
32 = box@(180, 180, 0)
}
}
which is correct, right?
The question now is, what do i put in on_input?
where x is a level number:
- on mouse_over for any node stored in self.levselbut[x] should increase the scale of all nodes that are part of self.levselbut[x]
- on mouse_off the scale goes back to normal
- clicking on a node in self.levselbut[x] should take you to level x.
(the other question is: is this very taxing for the processor? I am aware that the normal node limit is 1024)
Thanks for your help.