- 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
1.1 KiB
1.1 KiB
addDraw
Description
Adds a custom drawing function to the object, allowing users to create their own graphical representations using code.
Parameters
stringName (ID) - must be uniquefunctionThe function to be executed, containing the custom drawing codenumberOptional - Position, determines the order or priority of the drawingnumberOptional - Determines if the drawing should be added to the preDrawQueue, postDrawQueue, or drawQueue.1= drawQueue,2= preDrawQueue,3= postDrawQueue (default is drawQueue)booleanOptional - Whether the drawing should be rendered immediately or not, default istrue
Returns
objectThe object in use
Usage
local basalt = require("basalt")
local mainFrame = basalt.createFrame()
local function customDrawing()
-- Custom drawing code goes here
end
mainFrame:addDraw("uniqueID", customDrawing)
In this example, a custom drawing function is added to the main frame. The custom drawing code should be placed inside the customDrawing function. The drawing is given a unique ID, a position of 1, added to the drawQueue, and rendered immediately.