Difference between revisions of "Client Skinning"

From Starsonata Wiki
Jump to: navigation, search
Line 38: Line 38:
  
 
<code>&lt;element type="image"&gt;</code>  
 
<code>&lt;element type="image"&gt;</code>  
 +
 +
<code></code>
 +
 +
<code></code>
  
 
<code></code>  
 
<code></code>  
Line 60: Line 64:
 
  &lt;/attributes&gt;
 
  &lt;/attributes&gt;
 
</code>
 
</code>
 +
 +
<code></code>
 +
 +
<code></code>
  
 
<code></code>  
 
<code></code>  
Line 166: Line 174:
 
----
 
----
  
[[Category:Guides]] [[Category:C2_testing|Ss2_testing]] [[Category:Development:ContentDevelopment]]
+
[[Category:Guides]] [[Category:C2_testing|Ss2_testing]] [[Category:Development:ContentDevelopment|Content Development]]

Revision as of 20:16, 6 September 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

Variables

Game Manager Variables

player_shields
player_visibility
player_energy
player_hull_usage

player_shields_text
player_speed_text
player_energy_text
player_credits_text
player_hull_space_text