Files
Basalt/docs/objects/VisualObject.md
Robert Jelic bb1b1beb79 Basalt 1.7 Update
- New Objects (Flexbox, Graph, Treeview)
- Pluginsystem to add/remove functionality
- Reworked the entire Object system, instead of one big Object Class we have multiple classes: Object, VisualObject, ChangeableObject
- Instead of one big Frame Class we have multiple Frame Classes: BaseFrame, Frame, MovableFrame, ScrollableFrame, MonitorFrame, Flexbox
- Removed the Animation Object, and added a animation plugin instead
- Removed the Graphic Object and merged it's functionality with the image object
- Updated currently existing objects
2023-04-30 17:05:34 +02:00

4.3 KiB

The VisualObject class is derived from the Object class and serves as the foundation for all visual components in Basalt. Visual objects include elements like frames, buttons, and text boxes. The VisualObject class provides methods for managing the appearance, position, size, and other visual properties of these components.

Here's a list of commonly used methods in the VisualObject class:

show Makes the object visible
hide Makes the object invisible
setVisible Sets the visibility of the object
isVisible Returns the visibility status of the object
setPosition Sets the position of the object relative to its parent
getPosition Returns the current position of the object
getX Returns the current x-position of the object
getY Returns the current y-position of the object
setSize Sets the size (width and height) of the object
getSize Returns the current size of the object
getWidth Returns the current width of the object
getHeight Returns the current height of the object
setBackground Sets the background color of the object
getBackground Returns the current background color of the object
setForeground Sets the text color of the object
getForeground Returns the current text color of the object
setTransparency Sets whether transparency drawings should be used
setZIndex Changes the z-index
getAbsolutePosition Returns the absolute position of the object
ignoreOffset Ignores the parent's offset
isFocused Returns whether the object is the focused object
setShadow Sets the shadow color for the visual object
getShadow Returns the shadow color
setBorder Sets the object's border
animatePosition Uses animation to move the object
animateSize Uses animation to change the size of the object
animateOffset Uses animation change the offset of the object
addTexture Adds a background image texture (nfp or bimg)
setTextureMode Changes the way the texture gets drawn
setInfinitePlay Activates endless animation play

Custom drawing

The following list is made for custom draw calls:

addDraw Adds a new Draw call
addPreDraw Adds a new Pre-Draw call
addPostDraw Adds a new Post-Draw call
setDrawState Changes the draw state of a particular draw call
getDrawId Returns the id of a draw call
addText adds text inside a draw call
addBG adds background inside a draw call
addFG adds text color inside a draw call
addBlit adds text, bg and tc inside a draw call
addTextBox Adds a text box inside a draw call
addBackgroundBox Adds a background box inside a draw call
addForegroundBox Adds a foreground box inside a draw call

Events

onResize Triggers when the object is resized
onReposition Triggers when the object is repositioned