Difference between revisions of "LGUI2:Brushes"

From Lavish Software Wiki
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...")
 
Line 15: Line 15:
 
! 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]
 +
|-
 +
! imageOrientation
 +
| A string or array of strings indicating "normal" "mirrorHorizontal" and/or "mirrorVertical". These transforms will apply to the image.
 
|-
 
|-
 
! pixelShader
 
! pixelShader

Revision as of 14:53, 26 June 2018

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 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.
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]
imageOrientation A string or array of strings indicating "normal" "mirrorHorizontal" and/or "mirrorVertical". These transforms will apply to the image.
pixelShader A PixelShader 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.

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"
}