natiny.view.get_rect

Lua
natiny.view.get_rect(view) -> x, y, width, height

Returns the rectangle a view was given the last time it was laid out.

Parameters

Name Type Description
view number View handle

Returns

Type Description
number Left edge, in drawing units
number Top edge, in drawing units
number Width, in drawing units
number Height, in drawing units

Example

Lua
natiny.view.set_hook(panel, natiny.view.HOOK_DRAW, function(self)
    natiny.render.set_color(PANEL)
    natiny.render.rectangle(natiny.view.get_rect(self))
end)