Difference between revisions of "LGUI2:Brushes"
Jump to navigation
Jump to search
(Created page with "A Brush is used to "paint" something, so to speak. A Brush consists of a color, an optional image file, and an optional pixel shader. == Defining a Brush == A Brush is define...") |
|||
(7 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | A Brush is used to "paint" something, so to speak. A Brush consists of a color, an optional image file, and an optional pixel shader. | + | A [[LavishGUI 2]] Brush is used to "paint" something, so to speak. A Brush consists of a color, an optional image file or [[LGUI2:Canvas|Canvas]], and an optional pixel shader and vertex shader. |
+ | |||
== Defining a Brush == | == Defining a Brush == | ||
Line 9: | Line 10: | ||
! color | ! color | ||
| A [[LGUI2:Color|Color]] definition. If not given, the default is [1.0, 0, 0, 0], although note that this may be overriden by a [[LGUI2:Template|Template]]. | | A [[LGUI2:Color|Color]] definition. If not given, the default is [1.0, 0, 0, 0], although note that this may be overriden by a [[LGUI2:Template|Template]]. | ||
+ | |- | ||
+ | ! canvas | ||
+ | | A [[LGUI2:Canvas|Canvas]] definition | ||
|- | |- | ||
! imageFile | ! imageFile | ||
Line 15: | Line 19: | ||
! imageFileTransparencyKey | ! imageFileTransparencyKey | ||
| A [[LGUI2:Color|Color]] definition specifying the Transparent color of the image file. If not given, the default is [0, 0, 0, 0] | | A [[LGUI2:Color|Color]] definition specifying the Transparent color of the image file. If not given, the default is [0, 0, 0, 0] | ||
+ | |- | ||
+ | ! imageBrush | ||
+ | | A Brush to use for an image | ||
+ | |- | ||
+ | ! imageOrientation | ||
+ | | A string or array of strings indicating "normal" "mirrorHorizontal" and/or "mirrorVertical". These transforms will apply to the image. | ||
|- | |- | ||
! pixelShader | ! pixelShader | ||
− | | A [[LGUI2: | + | | A [[LGUI2:Pixel Shader|Pixel Shader]] definition. The pixel shader provides the final color for each pixel, given the color and the image (if given) and other pixel shader-y things. |
+ | |- | ||
+ | ! vertexShader | ||
+ | | A [[LGUI2:Vertex Shader|Vertex Shader]] definition. | ||
|} | |} | ||
+ | |||
+ | |||
+ | === Using a global brush === | ||
+ | Brushes can also be defined directly in a [[LGUI2:Skin|Skin]] under "brushes'. Brushes defined this way will pre-load images or canvases, keeping them loaded for when the brush is to be used. | ||
+ | |||
+ | To refer to a global brush, use a string specifying its name instead of defining a new brush with a JSON object. For example, if a brush named "white" is defined in an active Skin, then something like this can be used to refer to that brush: | ||
+ | "backgroundBrush":"white" | ||
+ | |||
== Examples == | == Examples == | ||
Line 33: | Line 54: | ||
} | } | ||
+ | |||
+ | {{LGUI2:Topic}} | ||
[[Category:LavishGUI 2]] | [[Category:LavishGUI 2]] | ||
+ | [[Category:LavishGUI 2 Brushes]] |
Latest revision as of 21:17, 5 November 2019
A LavishGUI 2 Brush is used to "paint" something, so to speak. A Brush consists of a color, an optional image file or Canvas, and an optional pixel shader and vertex shader.
Defining a Brush
A Brush is defined by a JSON object enclosed by {}.
Brush properties | |
---|---|
color | A Color definition. If not given, the default is [1.0, 0, 0, 0], although note that this may be overriden by a Template. |
canvas | A Canvas definition |
imageFile | An image filename. If not given, no image file is used. |
imageFileTransparencyKey | A Color definition specifying the Transparent color of the image file. If not given, the default is [0, 0, 0, 0] |
imageBrush | A Brush to use for an image |
imageOrientation | A string or array of strings indicating "normal" "mirrorHorizontal" and/or "mirrorVertical". These transforms will apply to the image. |
pixelShader | A Pixel Shader definition. The pixel shader provides the final color for each pixel, given the color and the image (if given) and other pixel shader-y things. |
vertexShader | A Vertex Shader definition. |
Using a global brush
Brushes can also be defined directly in a Skin under "brushes'. Brushes defined this way will pre-load images or canvases, keeping them loaded for when the brush is to be used.
To refer to a global brush, use a string specifying its name instead of defining a new brush with a JSON object. For example, if a brush named "white" is defined in an active Skin, then something like this can be used to refer to that brush:
"backgroundBrush":"white"
Examples
- A brush with a completely normal image file (via blending with solid white)
{ "color": [ 1.0, 1.0, 1.0 ], "imageFile": "myImage.png" }
- A brush blending solid blue with an image file
{ "color": [ 0, 0, 1.0 ], "imageFile": "myImage.png" }
LavishGUI 2 Topics