Difference between revisions of "Client Skinning"

From Starsonata Wiki
Jump to: navigation, search
(added category)
Line 19: Line 19:
 
== XML Documentation  ==
 
== XML Documentation  ==
  
=== Button ===
+
=== Button ===
  
=== Window ===
+
=== Window ===
  
=== WindowTrans ===
+
=== WindowTrans ===
  
=== ModalScreen ===
+
=== ModalScreen ===
  
=== MessageBox ===
+
=== MessageBox ===
  
=== ScrollBar ===
+
=== ScrollBar ===
  
 
=== Image  ===
 
=== Image  ===
Line 38: Line 38:
  
 
<code>&lt;element type="image"&gt;</code>  
 
<code>&lt;element type="image"&gt;</code>  
 +
 +
<code></code>
  
 
<code></code>  
 
<code></code>  
Line 52: Line 54:
 
  &lt;/attributes&gt;
 
  &lt;/attributes&gt;
 
</code>
 
</code>
 +
 +
<code></code>
  
 
<code></code>  
 
<code></code>  
Line 61: Line 65:
 
==== Notes:  ====
 
==== Notes:  ====
  
Rect is the coordinates that the image will appear
+
Rect is the coordinates that the image will appear  
  
 
The texture name is the name of an image specified in images.xml  
 
The texture name is the name of an image specified in images.xml  
Line 67: Line 71:
 
ImageRect specifies a subset of the image to display  
 
ImageRect specifies a subset of the image to display  
  
Color is in the aarrggbb format
+
Color is in the aarrggbb format  
  
 
=== Rectangle  ===
 
=== Rectangle  ===
Line 78: Line 82:
  
 
=== Checkbox  ===
 
=== Checkbox  ===
<pre><code>&lt;element type="checkBox"&gt;
+
<pre>&lt;code&gt;&lt;element type="checkBox"&gt;
 
   &lt;attributes&gt;
 
   &lt;attributes&gt;
 
     &lt;string name="IdName" value="" /&gt;
 
     &lt;string name="IdName" value="" /&gt;
Line 103: Line 107:
 
   &lt;/attributes&gt;
 
   &lt;/attributes&gt;
 
&lt;/element&gt;
 
&lt;/element&gt;
</code></pre>
+
&lt;/code&gt;</pre>  
=== Table ===
+
=== Table ===
 
 
=== MeshViewer ===
 
 
 
=== StaticText ===
 
  
=== EditBox ===
+
=== MeshViewer  ===
  
=== SpinBox ===
+
=== StaticText  ===
  
=== TabControl ===
+
=== EditBox  ===
  
=== Tab ===
+
=== SpinBox  ===
  
=== ContextMenu ===
+
=== TabControl  ===
  
=== Menu ===
+
=== Tab  ===
  
=== Toolbar ===
+
=== ContextMenu  ===
  
=== ComboBox ===
+
=== Menu  ===
  
=== Chat ===
+
=== Toolbar  ===
  
=== RadioButtonGroup ===
+
=== ComboBox  ===
  
=== RadioCheckboxGroup ===
+
=== Chat  ===
  
=== Slider ===
+
=== RadioButtonGroup  ===
  
=== Tutorial ===
+
=== RadioCheckboxGroup  ===
  
=== Callback ===
+
=== Slider  ===
  
 +
=== Tutorial  ===
  
 +
=== Callback  ===
  
 
----
 
----
  
 
[[Category:Guides]]
 
[[Category:Guides]]
 +
[[Category:C2_testing|Ss2_testing]]

Revision as of 13:25, 7 March 2011

Client 2 Skinning Guide

Creating a New Skin

In Client 2, instead of editing the files in place, you actually create a new folder in the Contents dir. This will allow us to patch files without overwriting mods and allow people to share mods more easily.

Here is an example of creating a simple mod for C2:

  1. Create Contents/<newSkinName>/ next to Contents/Default
  2. Copy the appropriate file from Contents/Default/<dir1>/<dir2> to Contents/<newSkinName>/<dir1>/<dir2>
  3. Make the changes you want to make to the file
  4. Change the UserConfig.xml packages attribute to read packages="<newSkinName> Default" instead of packages="Default"
    • This will tell C2 to first look in <newSkinName> for the files it needs, then revert to Default for anything it doesn't find. You can chain many of these packages to apply multiple mods. (Eventually we'll have a UI mod manager as well).

Lastly, the packages attribute can also read in zip files, so you could place a zip file named <newSkinName>.zip in Contents/ and add it to the packages in the same way, and it would read it. (This will make it even easier to share mods with others)

Any questions related to this can be sent to pip on the forums or asked on IRC.

XML Documentation

Button

Window

WindowTrans

ModalScreen

MessageBox

ScrollBar

Image

<element type="image">

Example:

<element type="image">

 <attributes>
<rect name="Rect" value="12, 37, 483, 305" />
<texture name="Texture" value="background.station.ships" />
<bool name="UseAlphaChannel" value="true" />
<color name="Color" value="9fffffff" />
<rect name="ImageRect" value="25, 63, 498, 333" />
</attributes>

</element>

Notes:

Rect is the coordinates that the image will appear

The texture name is the name of an image specified in images.xml

ImageRect specifies a subset of the image to display

Color is in the aarrggbb format

Rectangle

<element type="rectangle">

  <attributes>
    <string name="IdName" value="" />
    <string name="TextID" value="" />
    <int name="Id" value="-1" />
    <string name="Caption" value="" />
    <rect name="Rect" value="0, 0, 1, 1" />
    <position name="MinSize" value="1, 1" />
    <position name="MaxSize" value="0, 0" />
    <bool name="NoClip" value="false" />
    <enum name="LeftAlign" value="upperLeft" />
    <enum name="RightAlign" value="upperLeft" />
    <enum name="TopAlign" value="upperLeft" />
    <enum name="BottomAlign" value="upperLeft" />
    <bool name="Visible" value="true" />
    <bool name="Enabled" value="true" />
    <bool name="TabStop" value="false" />
    <bool name="TabGroup" value="false" />
    <int name="TabOrder" value="-1" />
    <color name="col_left_up" value="ffffffff" />
    <color name="col_right_up" value="ffffffff" />
    <color name="col_left_down" value="ffffffff" />
    <color name="col_right_down" value="ffffffff" />
  </attributes>

</element>

Checkbox

<code><element type="checkBox">
  <attributes>
    <string name="IdName" value="" />
    <string name="TextID" value="" />
    <int name="Id" value="-1" />
    <string name="Caption" value="" />
    <rect name="Rect" value="0, 0, 1, 1" />
    <position name="MinSize" value="1, 1" />
    <position name="MaxSize" value="0, 0" />
    <bool name="NoClip" value="false" />
    <enum name="LeftAlign" value="upperLeft" />
    <enum name="RightAlign" value="upperLeft" />
    <enum name="TopAlign" value="upperLeft" />
    <enum name="BottomAlign" value="upperLeft" />
    <bool name="Visible" value="true" />
    <bool name="Enabled" value="true" />
    <bool name="TabStop" value="true" />
    <bool name="TabGroup" value="false" />
    <int name="TabOrder" value="3" />
    <bool name="Checked" value="false" />
    <int name="IconChecked" value="-1" />
    <int name="IconUnchecked" value="-1" />
    <string name="IconBankName" value="" />
  </attributes>
</element>
</code>

Table

MeshViewer

StaticText

EditBox

SpinBox

TabControl

Tab

ContextMenu

Menu

Toolbar

ComboBox

Chat

RadioButtonGroup

RadioCheckboxGroup

Slider

Tutorial

Callback