Page 1 of 1

Viewport

Posted: Tue May 05, 2015 3:26 am
by Incinirate
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.

Re: Viewport

Posted: Tue May 05, 2015 2:25 pm
by Rseding91
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.
I believe you can loop over the GUI elements of the player using something like:

(untested)

Code: Select all

for k,v in pairs(game.getplayer(1).gui.top) do game.getplayer(1).print(v.name) end