File geyser/GeyserContainer.lua
Functions
Geyser.Container:flash (time) | Flashes a white box over the dimensions of this container. |
Geyser.Container:hide () | Hides this window and all its contained windows. |
Geyser.Container:move (x, y) | Moves this window according to the new x and y contraints set. |
Geyser.Container:new (cons, container) | Constructor for containers. |
Geyser.Container:reposition () | Responsible for placing/moving/resizing this window to the correct place/size. |
Geyser.Container:resize (width, height) | Resizes this window according to the new width and height constraints set. |
Geyser.Container:setFontSize (fontSize) | Sets the default font size for this window. |
Geyser.Container:set_constraints (cons) | Sets all contraints (x, y, width, height) for this window. |
Geyser.Container:show () | Shows this window and all windows it contains. |
Tables
Geyser.Container | Represents a generic container with positional information. |
Functions
- Geyser.Container:flash (time)
-
Flashes a white box over the dimensions of this container. This is very useful to see where a container actually is if you've forgotten its details.
Parameters- time: Time in seconds to flash for, default is 1.0s.
- Geyser.Container:hide ()
-
Hides this window and all its contained windows.
- Geyser.Container:move (x, y)
-
Moves this window according to the new x and y contraints set.
Parameters- x: New x constraint to use. If nil, uses current value.
- y: New y constraint to use. If nil, uses current value.
- Geyser.Container:new (cons, container)
-
Constructor for containers. This function creates a new container/window
Parameters- cons: Any Lua table that contains appropriate constraint entries. Include any parameter such as name or fontSize in cons that are to be used for the new window.
- container:
- Geyser.Container:reposition ()
-
Responsible for placing/moving/resizing this window to the correct place/size. Called on window resize events.
- Geyser.Container:resize (width, height)
-
Resizes this window according to the new width and height constraints set.
Parameters- width: New width constraint to use. If nil, uses current value.
- height: New height constraint to use. If nil, uses current value.
- Geyser.Container:setFontSize (fontSize)
-
Sets the default font size for this window. Will resizes this window if necessary to meet constraints.
Parameters- fontSize: The new font size to use.
- Geyser.Container:set_constraints (cons)
-
Sets all contraints (x, y, width, height) for this window.
Parameters- cons: Any Lua table that contains appropriate constraint entries.
- Geyser.Container:show ()
-
Shows this window and all windows it contains.
Tables
- Geyser.Container
- Represents a generic container with positional information. Has no notion of contents and is used to contain other windows and impose some sense of order.
Fields
- parent: The parent class of this window
- type: The type of this window, usually lowercase of the classname and can be used in checks for certain types. For a Container instance, type is “container.”
- name: The name of this window. This is the same name that Mudlet will use internally for primitive types like labels and miniconsoles. If not specified in the constraints table during creation, an anonymous name unique to this session will be made up.
- x: The x-coordinate relative to this window's container, not absolute from the Mudlet main window. This is not a number, but a constraint specification. To find out the numeric x-coordinate in terms of pixels from the Mudlet main window's origin, use the get_x() method. Default is "10px".
- y: The y-coordinate relative to this window's container, not absolute from the Mudlet main window. This is not a number, but a constraint specification. To find out the numeric y-coordinate in terms of pixels from the Mudlet main window's origin, use the get_y() method. Default is "10px".
- width: The width of this window, possibly relative to the window's container. This is not a number, but a constraint specification. To find out the numeric width in terms of pixels, use the get_width() method. Default is "300px".
- height: The height of this window, possibly relative to the window's container. This is not a number, but a constraint specification. To find out the numeric width in terms of pixels, use the get_width() method. Default is "200px".
- windowList: This is a list of all windows held by this container. It used to handle proper resizing of held windows as well as during show()s and hide()s to recursive show and hide all children windows.
- fontSize: The default size font used when calculating dimensions based on the character constraint. Default is 8.