Files
Basalt/docs/objects/Object.md
Robert Jelic 4d614372a1 Updated docs
There is still stuff to do
2022-08-28 18:18:26 +02:00

3.0 KiB

This is the base class for all visual objects. It covers positioning, sizing, showing/hiding and much more.

By default a freshly created object is visible and automatically listens to all incoming events. Its default position is always 1, 1 (based on it's parent frame). The default anchor is also topLeft.

show Makes the object visible
hide Makes the object invisible
isVisible Returns if the object is currently visible
enable Listens to incoming events
disable Ignores all incoming events
setPosition Changes the position (x,y)
getPosition Returns the current position
setBackground Changes the object's background
setForeground Changes the object's text color
setSize Changes the object to a new size
getSize Returns the width and height
setFocus Changes the object to be the focused object
isFocused Returns if the object is currently focused
setZIndex Changes the z-index
setParent Changes the parent of that object
getAnchorPosition Returns the relative x and y coordinates of that object
setAnchor Sets the current anchor
getAbsolutePosition Returns the absolute x and y coordinates of that object
setValue Changes the stored value
getValue Returns the currently stored value
getName Returns the name (or in other words: id) of that object
setShadow Changes the shadow of that object
setBorder Changes the border lines

Events

onClick Fires as soon as the object gets clicked
onClickUp Fires as soon as the mouse button gets released on the object
onScroll Fires as soon as you scroll with the mousewheel
onDrag Fires as soon as the object is beeing dragged
onKey Fires when the object is focused and a keyboard key has been clicked
onKeyUp Fires when the object is focused and a keyboard key has been released
onChange Fires when the object value has been changed
onResize Fires when the object got resized
onReposition Fires when the object has been repositioned
onGetFocus Fires when the object is focused
onLoseFocus Fires when the object lost it's focus