SigServer:SignatureXML: Difference between revisions

no edit summary
No edit summary
 
(32 intermediate revisions by 6 users not shown)
Line 1: Line 1:
== Root Element ==
{{TOCright}}
Each signature is required to have a root element, <signature> in this case. The root tag accepts the attribute quality. It set's the quality when output as JPEG is selected. It may be set to anything between 0 - 100, default 90.


'''Example'''
Back to: [[SigServer:Documentation]]
<signature quality="90">
</signature>
 
The root element has two child elements, [[#Variables|<variables>]] and [[#Layout|<layout>]].
 
The layout is contolled by a XML based scripting language. Each signature must have the root tag (<signature>). The <signature> tag has two subelements: <variables> and <layout>. When using JPEG as output the <signature> accepts the attribute quality. It may be any value between 1-100. Default value is 100 (Max).
 
The <variables> tag enables the user to define his own variables using a sub element called <set>. <set> has the following attributes, which both are required, <set name="testvar" value="test" />. To access the variable @ followed by the variable's name is used. A variable can only be accessed inside the curly brackets, i.e. {{ @testvar; }} will output test and just @testvar will output @testvar.
 
The default value for each tag (only text supported at the moment) may be overridden using the <default> tag. It is a sub tag of the <variables> tag. Example usage so override the default text color: <default element="text" name="color" value="#FFFFFF" />. That sets the text default color to white.


=== Variables ===
= Root Element =
Inside this element you may define your own variables or override an elements default value.
Each signature is required to have a root element, <tt><signature></tt> in this case. The root tag accepts the attribute quality. It set's the quality when output as JPEG is selected. It may be set to anything between <tt>0 - 100</tt>, default <tt>90</tt>.
 
==== User defined variables ====
To define a variable the <set> tag is used. It has the two attributes, name and value.


'''Example'''
'''Example'''
  <signature>
  <signature quality="90">
<variables>
<set name="foo" value="bar" />
</variables>
  </signature>
  </signature>


The example above defines the variable ''@foo'' which has the value ''bar''. Note that the @ should not be included in the variable's name.
The root element has two child elements, [[#Defaults|<defaults>]] and [[#Layout|<layout>]].


==== Override default value ====
== Defaults ==
'''NOTE: Only text element supported for now.'''
Inside this element you may override an element's default value.


To override an element's default value the <default> tag is used. It has three attributes, element, name and value.
To override default element values the <tt><defaults></tt> tag is used. Inside the <tt><defaults></tt> tag elements are defined as usual.


'''Example'''
'''Example'''
  <signature>
  <signature>
<variables>
    <defaults>
<default element="text" name="face" value="courier" />
        <text color="#ff0000" />
</variables>
        <shape type="rectangle" color="#0000ff" />
    </defaults>
  </signature>
  </signature>


The example sets the default attribute ''face'' of the element ''text'' to ''courier''.
This sets the texts' default color to red and the rectangles' to blue.


=== Layout ===
=== User defined variables ===
All text, shapes and images are controlled by sub elements to <code><layout></code>.
'''[[SigServer:SignatureMath#Variables|New way of setting user variables available.]]''' Old way deprecated.


==== Image ====
== Layout ==
The <code><image></code> tag allows the user to include an image, chosen from the collection in the library section.
All text, shapes and images are controlled by sub elements to <tt><layout></tt>.


{| class="wikitable"
Please note that all items are added sequentially in the order listed in your signature's XML code. For example, if you draw some text first in your code, and then draw an opaque rectangle in that same location later on in your code, the rectangle will be drawn over top of that text, so only the rectangle will be visible. Make sure you draw your bottommost layers first to avoid that kind of problem.
|-
! Attribute !! Description !! Values !! Default
|-
| src || Sets which image that should be included || Any title available in the library || ''none''
|-
| position || Sets the included image's position || ''x-pos''x''y-pos''|| 0x0
|-
| size || Sets the included image's size || ''width''x''height'' || Image's own size
|}


==== Shape ====
=== Image ===
The <tt><image></tt> tag allows the user to include an image, chosen from the collection in the library section.


{| class="wikitable"
{| class="wikitable"
Line 66: Line 42:
! Attribute !! Description !! Values !! Default
! Attribute !! Description !! Values !! Default
|-
|-
| type || Defines the type of shape. || rectangle, ellipse or line || ''none''
| src || Sets which image that should be included. Can't be used together with attribute ''anime''. || Any title available in the library || ''none''
|-
|-
| position || Sets the shape's position. || ''x-pos''x''y-pos''|| 0x0
| anime || Includes the image of the ID provided. Can't be used together with attribute ''src''. || Any Anime ID || ''none''
|-
|-
| size || Sets the shape's size. || ''width''x''height'' || 10x10
| position || Sets the included image's position. (X and Y must be integers) || ''x-pos''x''y-pos''|| 0x0
|-
|-
| color || Sets the shape's color. || ''#<hex>'' or ''R, G, B'' || #000000
| size || Sets the included image's size. (width and height must be integers) || ''width''x''height'' || Image's own size
|-
|-
| alpha || Sets the shape's opacity. Doesn't work very well with ellipses || ''1-100'' || 100
| display || Sets whether the image is visible or not. || ''true'' or ''false'' || true
|-
|-
| hollow || Sets whether the shape should be hollow or not. || ''true'' or ''false'' || true
| method || Sets resizing method. Crop cuts of excess parts. Resize scales the image to fit given size. Cropresize resizes then crops and maintains aspect ratio. || ''crop'', ''resize'' or ''cropresize'' || cropresize
|-
|-
| thickness || Sets the border's thickness. Works on lines and hollow shapes. || ''1-10'' || 1
| restricted || Display restricted images, i.e. explicit images a.k.a. hentai. || ''true'' or ''false''|| false
|}
|}


==== Text ====
=== Shape ===
 
{| class="wikitable"
{| class="wikitable"
|-
|-
! Attribute !! Description !! Values !! Default
! Attribute !! Description !! Values !! Default
|-
|-
| position || Sets the text's position. Relative to the bottom left corner, if nothing else is set in the align attribute. || ''x-pos''x''y-pos''|| 0x0
| type || Defines the type of shape. || ''rectangle'', ''ellipse'', ''pie'', ''arc'' or ''line'' || ''none''
|-
|-
| size || Sets the text's size. || ''width''x''height'' || 10x10
| position || Sets the shape's position. (X and Y must be integers) || ''x-pos''x''y-pos''|| 0x0
|-
|-
| color || Sets the text's color. || ''#<hex>'' or ''R, G, B'' || #000000
| size || Sets the shape's size. (width and height must be integers) || ''width''x''height'' || 10x10
|-
|-
| alpha || Sets the text's opacity. Doesn't work very well with ellipses || ''1-100'' || 100
| color || Sets the shape's colour. || ''#<hex>'' or ''R, G, B'' || #000000
|-
|-
| angle || Sets the text's || ''true'' or ''false'' || true
| alpha || Sets the shape's opacity. Doesn't work very well with ellipses (must be an integer) || ''1-100'' || 100
|-
|-
| thickness || Sets the border's thickness. Works on lines and hollow shapes. || ''1-10'' || 1
| hollow || Sets whether the shape should be hollow or not. || ''true'' or ''false'' || false
|-
| thickness || Sets the border's thickness. Works on lines and hollow shapes. (must be an integer) || ''1-10'' || 1
|-
| display || Sets whether the shape is visible or not. || ''true'' or ''false'' || true
|-
| angle ''(pie and arc only)'' || Sets the pie's/arc's start and end angle in degrees (only positive angles and they must be integers) || ''stop'' or ''start''-''end''; ''0-720'' || 0-90
|}
|}


===== Line =====
=== Text ===
{| class="wikitable"
{| class="wikitable"
|-
|-
! Attribute !! Description !! Values !! Default
! Attribute !! Description !! Values !! Default
|-
|-
| src || Sets which image that should be included || Any title available in the library || ''none''
| position || Sets the text's position. Relative to the bottom left corner, if nothing else is set in the align attribute. (X and Y must be integers) || ''x-pos''x''y-pos''|| 0x0
|-
| position || Sets the included image's position || ''x-pos''x''y-pos''|| 0x0
|-
|-
| size || Sets the included image's size || ''width''x''height'' || Image's own size
| size || Sets the text's size. (width and height must be integers) || ''width''x''height'' || 10x10
|}
 
==== Shape ====
 
{| class="wikitable"
|-
|-
! Attribute !! Description !! Values !! Default
| color || Sets the text's colour. || ''#<hex>'' or ''R, G, B'' || #000000
|-
|-
| type || Defines the type of shape. || rectangle, ellipse or line || ''none''
| alpha || Sets the text's opacity. (must be an integer) || ''1-100'' || 100
|-
|-
| position || Sets the shape's position. || ''x-pos''x''y-pos''|| 0x0
| align || Sets the text's alignment. Note that the vertical alignment currently only considers the positioning of the first line. || Any combination of ''bottom'', ''middle'', ''top'' and ''left'', ''center'', ''right'' with a dash in between || bottom-left
|-
|-
| size || Sets the shape's size. || ''width''x''height'' || 10x10
| face || Sets the text's face. || See [[SigServer:Fonts|font list]] for all font's with recommended size || verdana
|-
|-
| color || Sets the shape's color. || ''#<hex>'' or ''R, G, B'' || #000000
| angle || Sets the text's angle. (must be an integer)  || ''0-359'' || 0
|-
|-
| alpha || Sets the shape's opacity. Doesn't work very well with ellipses || ''1-100'' || 100
| line-space || Sets the spacing between the lines. || ''number'' || 1.5
|-
|-
| hollow || Sets whether the shape should be hollow or not. || ''true'' or ''false'' || true
| thickness || Sets the border's thickness. Works on lines and hollow shapes. (must be an integer) || ''1-10'' || 1
|-
|-
| thickness || Sets the border's thickness. Works on lines and hollow shapes. || ''1-10'' || 1
| display || Sets whether the text is visible or not. || ''true'' or ''false'' || true
|}
|}


==== Text ====
==== Line ====
 
{| class="wikitable"
{| class="wikitable"
|-
|-
! Attribute !! Description !! Values !! Default
! Attribute !! Description !! Values !! Default
|-
|-
| colspan="4" | Same as text except position and align.
| colspan="4" | Same as Text except no 'position' or 'align' attribute.
|}
|}
[[Category:SigServer]]
92

edits

MediaWiki spam blocked by CleanTalk.
MediaWiki spam blocked by CleanTalk.