-
-
Notifications
You must be signed in to change notification settings - Fork 16
OSL ‐ Modifiers
Modifiers in OriginOS scripting allow for dynamic adjustments to various properties of UI elements, such as color, position, and size. They provide a flexible way to customize the appearance and behavior of UI elements based on different conditions. Below is a guide to common modifiers and how to use them effectively:
https://osl.mistium.com/#C_About
The general syntax for applying modifiers is:
command : modifier modifier
Modifiers are appended after a colon (:
) following a command, and multiple modifiers can be chained together.
Changes the color of the UI element.
Example:
square 100 100 2 : c#ff0000
This example draws a square with a width and height of 100 pixels, a border weight of 2, and sets its color to red (#ff0000
).
Adjusts the X position of the UI element.
Example:
icon "icon-name" 20 : chx#50
This example draws an icon named "icon-name" with a size of 20 and shifts its X position by 50 pixels.
Adjusts the Y position of the UI element.
Example:
text "Hello" 16 : chy#-30
This example renders the text "Hello" with a font size of 16 and shifts its Y position upward by 30 pixels.
Specifies the color when the UI element is being hovered.
Example:
button "Click me" : hover_c#00ff00
In this case, a button with the label "Click me" is created, and its color changes to green (#00ff00
) when hovered.
Adjusts the size of the UI element when it is being hovered.
Example:
image "image-url" 120 : hover_size#1.2
This example renders an image with a specified URL and width of 120 pixels. When hovered, the image size increases to 1.2 times its original size.
square 50 50 1 : c#336699 chx#20 chy#-10 hover_c#ff9900 hover_size#1.1
In this combined example, a square with a size of 50 pixels, border weight of 1, color #336699
, and initial X and Y positions is drawn. When hovered, the color changes to #ff9900
, and the size increases by 10%.
Feel free to experiment with different combinations of modifiers to achieve the desired appearance and behavior for your UI elements in originOS scripting.
originOS is a web desktop gui with a self contained file system, programming languages, internet system and a whole lot of stuff an os should be able to do Use originOS here