Modifiers
Description
Modifiers in OSL allow for dynamic adjustments to UI elements' properties such as color, position, and size. They provide a flexible way to customize the appearance and behavior of UI elements based on different conditions.
Syntax
Modifiers are appended after a colon (:
) following a command. Multiple modifiers can be chained together.
Common Modifiers
Color Modifiers
c#hexcode
: Sets the color of the elementhover_c#hexcode
: Sets the color when the element is hovered
Example:
Position Modifiers
chx#value
: Changes the X position by the specified amountchy#value
: Changes the Y position by the specified amount
Example:
Size Modifiers
hover_size#scale
: Adjusts the element's size on hover (1.0 is normal size)
Example:
Combined Usage
Modifiers can be combined to create complex behaviors:
Important Notes
Modifiers are processed in order from left to right
Color modifiers affect the entire element
Position modifiers are relative to the original position
Hover modifiers only take effect when the mouse is over the element
Multiple modifiers of the same type will use the last one specified
For the most up-to-date list of modifiers, refer to: https://osl.mistium.com/#C_About
Last updated
Was this helpful?