Files
Basalt/docs/objects/Container/setImportant.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

37 lines
915 B
Markdown

## setImportant
### Description
Sets the specified object as "important" within the container. This means the object will be reordered on the same z-index level, making it more important than other objects on the same level. This can be useful when you want to prioritize event handling or drawing order for specific objects.
### Parameters
1. `string` The object to set as important
### Returns
1. `object` the object in use
### Usage
```lua
local main = basalt.createFrame()
local container = main:addFrame()
local inputField1 = container:addInput()
:setPosition(2, 2)
local inputField2 = container:addInput()
:setPosition(2, 4)
inputField1:onKey(function(event, key)
basalt.debug("InputField1 received key press: ", key)
end)
inputField2:onKey(function(event, key)
basalt.debug("InputField2 received key press: ", key)
end)
container:setImportant(inputField1)
basalt.autoUpdate()
```