So, I've been looking all over the wiki trying to figure out how to get the active player's viewport (for reference for placing GUI elements) and can't find anything. Does anyone know how to do this? Or if its even possible with the current modding interface?
EDIT: More accurately, I'm looking for a way to figure out how many blocks are viewable in the screen at any given moment.
Viewport
-
- Burner Inserter
- Posts: 18
- Joined: Sun May 03, 2015 9:50 pm
- Contact:
Re: Viewport
I believe you can loop over the GUI elements of the player using something like:Incinirate wrote:So, I've been looking all over the wiki trying to figure out how to get the active player's viewport (for reference for placing GUI elements) and can't find anything. Does anyone know how to do this? Or if its even possible with the current modding interface?
EDIT: More accurately, I'm looking for a way to figure out how many blocks are viewable in the screen at any given moment.
(untested)
Code: Select all
for k,v in pairs(game.getplayer(1).gui.top) do game.getplayer(1).print(v.name) end
If you want to get ahold of me I'm almost always on Discord.