https://www.lavishsoft.com/wiki/index.php?title=LGUI2:Canvas_Operation&feed=atom&action=historyLGUI2:Canvas Operation - Revision history2024-03-28T18:18:11ZRevision history for this page on the wikiMediaWiki 1.33.0https://www.lavishsoft.com/wiki/index.php?title=LGUI2:Canvas_Operation&diff=8400&oldid=prevLax at 11:40, 4 October 20192019-10-04T11:40:45Z<p></p>
<table class="diff diff-contentalign-left" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">←Older revision</td>
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">Revision as of 11:40, 4 October 2019</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l15" >Line 15:</td>
<td colspan="2" class="diff-lineno">Line 15:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>! color</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>! color</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>| (Optional) A [[LGUI2:Color|Color]] definition</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>| (Optional) A [[LGUI2:Color|Color]] definition</div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">|-</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">! reset</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">| (Optional) If set to true, also resets the Font/Brush stack (default false). May be combined with initialize.</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">|-</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">! initialize</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">| (Optional) If set to true, also effectively does an "initialize" with "force" enabled (default false). May be combined with reset.</ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>|}</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>|}</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
</table>Laxhttps://www.lavishsoft.com/wiki/index.php?title=LGUI2:Canvas_Operation&diff=8398&oldid=prevLax: Created page with "A LGUI2:Canvas Operation| is a rendering instruction for a LGUI2:canvas|. Each Canvas Operation is defined by a JSON Object. When specifying a list of operations, suc..."2019-10-02T22:48:04Z<p>Created page with "A <a href="/wiki/index.php/LGUI2:Canvas_Operation" title="LGUI2:Canvas Operation">LGUI2:Canvas Operation</a> is a rendering instruction for a <a href="/wiki/index.php/LGUI2:canvas" title="LGUI2:canvas">LGUI2:canvas</a>. Each Canvas Operation is defined by a JSON Object. When specifying a list of operations, suc..."</p>
<p><b>New page</b></p><div>A [[LGUI2:Canvas Operation|Canvas Operation]] is a rendering instruction for a [[LGUI2:canvas|canvas]].<br />
<br />
Each Canvas Operation is defined by a JSON Object. When specifying a list of operations, such as the canvas' "initialize" property or a Batch call, the operation is specified by an "op" property. Otherwise, the operation is selected outside of the JSON (for example, LavishScript methods named DrawRect, DrawCircle, etc specify the operation instead).<br />
<br />
= List of Canvas Operations =<br />
== clear ==<br />
Clears the canvas (sets all pixels to the same value), either to transparent #00000000 or to a specified color value.<br />
<br />
{| border="1" style="border-collapse:collapse" cellpadding="5"<br />
!colspan="2"|clear operation properties<br />
|-<br />
! op<br />
| '''clear'''<br />
|-<br />
! color<br />
| (Optional) A [[LGUI2:Color|Color]] definition<br />
|}<br />
<br />
<br />
== initialize ==<br />
Initializes the Canvas by Batching its "initialize" array, if either a) it has not been auto-initialized since last allocated, or b) "force" is set to true<br />
<br />
{| border="1" style="border-collapse:collapse" cellpadding="5"<br />
!colspan="2"|initialize operation properties<br />
|-<br />
! op<br />
| '''initialize'''<br />
|-<br />
! force<br />
| (Optional) A boolean value specifying whether initialize should be Batched regardless of any prior state. This may be useful after a clear operation, which does not auto-initialize the canvas.<br />
|}<br />
<br />
<br />
== pushBrush ==<br />
Pushes a [[LGUI2:Brush|Brush]] onto the Brush stack for the Canvas. The top Brush on the stack is used for drawing.<br />
<br />
{| border="1" style="border-collapse:collapse" cellpadding="5"<br />
!colspan="2"|pushBrush operation properties<br />
|-<br />
! op<br />
| '''pushBrush'''<br />
|-<br />
! font<br />
| A string specifying the name of a Brush specified by the Canvas<br />
|}<br />
<br />
<br />
== popBrush ==<br />
Pops a [[LGUI2:Brush|Brush]] off the Brush stack for the Canvas. The top Brush on the stack is used for drawing.<br />
<br />
{| border="1" style="border-collapse:collapse" cellpadding="5"<br />
!colspan="2"|popBrush operation properties<br />
|-<br />
! op<br />
| '''popBrush'''<br />
|-<br />
! font<br />
| (Optional) A string specifying the name of a Brush specified by the Canvas<br />
|}<br />
<br />
<br />
== pushFont ==<br />
Pushes a [[LGUI2:Font|Font]] onto the Font stack for the Canvas. The top Font on the stack is used for drawing text.<br />
<br />
{| border="1" style="border-collapse:collapse" cellpadding="5"<br />
!colspan="2"|pushFont operation properties<br />
|-<br />
! op<br />
| '''pushFont'''<br />
|-<br />
! font<br />
| A string specifying the name of a Font specified by the Canvas<br />
|}<br />
<br />
<br />
== popFont ==<br />
Pops a [[LGUI2:Font|Font]] off the Font stack for the Canvas. The top Font on the stack is used for drawing text.<br />
<br />
{| border="1" style="border-collapse:collapse" cellpadding="5"<br />
!colspan="2"|popFont operation properties<br />
|-<br />
! op<br />
| '''popFont'''<br />
|-<br />
! font<br />
| (Optional) A string specifying the name of a Font specified by the Canvas<br />
|}<br />
<br />
<br />
== drawArc ==<br />
Draws an arc using the top [[LGUI2:Brush|Brush]] on the stack<br />
<br />
=== Form 1 ===<br />
{| border="1" style="border-collapse:collapse" cellpadding="5"<br />
!colspan="2"|popFont operation properties<br />
|-<br />
! op<br />
| '''drawArc'''<br />
|-<br />
! transform<br />
| A boolean value specifying whether to transform vertices by scaling to the canvas size. (default true)<br />
|-<br />
! x<br />
| A floating point value specifying the X-coordinate of the center of the arc<br />
|-<br />
! y<br />
| A floating point value specifying the Y-coordinate of the center of the arc<br />
|-<br />
! opacity<br />
| A floating point value specifying the opacity of the arc (default 1.0)<br />
|-<br />
! color<br />
| A [[LGUI2:Color|Color]] specifying the color to apply to the arc. If not specified, the Brush color is used.<br />
|-<br />
! startDegrees<br />
| A floating point value specifying the starting angle, in degrees clockwise from 3 o'clock.<br />
|-<br />
! endDegrees<br />
| A floating point value specifying the ending angle, in degrees clockwise from 3 o'clock.<br />
|-<br />
! innerRadius<br />
| A floating point value specifying the radius of the inner edge of the arc<br />
|-<br />
! outerRadius<br />
| A floating point value specifying the radius of the outer edge of the arc<br />
|-<br />
! segments<br />
| An integer value specifying the number of segments to generate along the outer edge of the arc. A higher value produces a higher resolution arc.<br />
|}<br />
<br />
=== Form 2 ===<br />
{| border="1" style="border-collapse:collapse" cellpadding="5"<br />
!colspan="2"|popFont operation properties<br />
|-<br />
! op<br />
| '''drawArc'''<br />
|-<br />
! transform<br />
| A boolean value specifying whether to transform vertices by scaling to the canvas size. (default true)<br />
|-<br />
! x<br />
| A floating point value specifying the X-coordinate of the center of the arc<br />
|-<br />
! y<br />
| A floating point value specifying the Y-coordinate of the center of the arc<br />
|-<br />
! opacity<br />
| A floating point value specifying the opacity of the arc (default 1.0)<br />
|-<br />
! color<br />
| A [[LGUI2:Color|Color]] specifying the color to apply to the arc. If not specified, the Brush color is used.<br />
|-<br />
! centerDegrees<br />
| A floating point value specifying the starting angle, in degrees clockwise from 3 o'clock.<br />
|-<br />
! innerArcLength<br />
| A floating point value specifying the arc length of the inner arc, in degrees<br />
|-<br />
! outerArcLength<br />
| A floating point value specifying the arc length of the outer arc, in degrees<br />
|-<br />
! innerRadius<br />
| A floating point value specifying the radius of the inner edge of the arc<br />
|-<br />
! outerRadius<br />
| A floating point value specifying the radius of the outer edge of the arc<br />
|-<br />
! segments<br />
| An integer value specifying the number of segments to generate along the outer edge of the arc. A higher value produces a higher resolution arc.<br />
|}<br />
<br />
<br />
== drawCircle ==<br />
{| border="1" style="border-collapse:collapse" cellpadding="5"<br />
!colspan="2"|drawCircle operation properties<br />
|-<br />
! op<br />
| '''drawCircle'''<br />
|-<br />
! transform<br />
| A boolean value specifying whether to transform vertices by scaling to the canvas size. (default true)<br />
|-<br />
! x<br />
| A floating point value specifying the X-coordinate of the center of the circle<br />
|-<br />
! y<br />
| A floating point value specifying the Y-coordinate of the center of the circle<br />
|-<br />
! radius<br />
| A floating point value specifying the radius of the circle<br />
|-<br />
! opacity<br />
| A floating point value specifying the opacity of the circle (default 1.0)<br />
|-<br />
! color<br />
| A [[LGUI2:Color|Color]] specifying the color to apply to the circle. If not specified, the Canvas' Foreground color is used.<br />
|}<br />
<br />
<br />
== drawRect ==<br />
{| border="1" style="border-collapse:collapse" cellpadding="5"<br />
!colspan="2"|drawRect operation properties<br />
|-<br />
! op<br />
| '''drawRect'''<br />
|-<br />
! transform<br />
| A boolean value specifying whether to transform vertices by scaling to the canvas size. (default true)<br />
|-<br />
! x<br />
| A floating point value specifying the X-coordinate of the top left corner of the rectangle<br />
|-<br />
! y<br />
| A floating point value specifying the Y-coordinate of the top left corner of the rectangle<br />
|-<br />
! width<br />
| A floating point value specifying the width of the rectangle<br />
|-<br />
! height<br />
| A floating point value specifying the height of the rectangle<br />
|-<br />
! opacity<br />
| A floating point value specifying the opacity of the text (default 1.0)<br />
|-<br />
! color<br />
| A [[LGUI2:Color|Color]] specifying the color to apply to the text. If not specified, the Canvas' Foreground color is used.<br />
|}<br />
<br />
<br />
== drawText ==<br />
{| border="1" style="border-collapse:collapse" cellpadding="5"<br />
!colspan="2"|drawText operation properties<br />
|-<br />
! op<br />
| '''drawText'''<br />
|-<br />
! transform<br />
| A boolean value specifying whether to transform vertices by scaling to the canvas size. (default true)<br />
|-<br />
! x<br />
| A floating point value specifying the X-coordinate of the top left corner of the text<br />
|-<br />
! y<br />
| A floating point value specifying the Y-coordinate of the top left corner of the text<br />
|-<br />
! opacity<br />
| A floating point value specifying the opacity of the text (default 1.0)<br />
|-<br />
! color<br />
| A [[LGUI2:Color|Color]] specifying the color to apply to the text. If not specified, the Canvas' Foreground color is used.<br />
|-<br />
! text<br />
| The text to render<br />
|}<br />
<br />
<br />
== drawPrimitives ==<br />
{| border="1" style="border-collapse:collapse" cellpadding="5"<br />
!colspan="2"|drawPrimitives operation properties<br />
|-<br />
! op<br />
| '''drawPrimitives'''<br />
|-<br />
! type<br />
| A string value specifying one of "triangleList" "triangleStrip" "lineList" "lineStrip" or "pointList"<br />
|-<br />
! transform<br />
| A boolean value specifying whether to transform vertices by scaling to the canvas size. (default true)<br />
|-<br />
! vertices<br />
| A JSON Array of canvas vertex definitions (see below)<br />
|}<br />
<br />
<br />
=== Canvas Vertex Definitions ===<br />
A Canvas Vertex can be specified either by a JSON Array or Object.<br />
<br />
{| border="1" style="border-collapse:collapse" cellpadding="5"<br />
!colspan="2"|canvas vertex properties<br />
|-<br />
! x<br />
| A floating point value specifying the X-coordinate<br />
|-<br />
! y<br />
| A floating point value specifying the Y-coordinate<br />
|-<br />
! tu<br />
| A floating point value specifying the texture X-coordinate (always between 0 and 1)<br />
|-<br />
! tv<br />
| A floating point value specifying the texture Y-coordinate (always between 0 and 1)<br />
|-<br />
! color<br />
| A [[LGUI2:Color|Color]] definition specifying the color to apply to the vertex. If not specified, the Brush color will be used.<br />
|-<br />
! opacity<br />
| A floating point value specifying the opacity value to use for the vertex. (default 1.0)<br />
|}<br />
<br />
Alternatively, the properties specified in the table above can be given in array form, in the listed order. In short: '''[x,y,tu,tv,color,opacity]'''<br />
<br />
<br />
[[Category:LavishGUI 2]]</div>Lax