Skinning How To/Add custom artwork to the viewer

From Second Life Wiki
< Skinning How To
Revision as of 17:22, 9 June 2008 by McCabe Maxsted (talk | contribs) (New page: = Introduction = A simple file replace is not all you can do with skinning. You can also add your own artwork, with your own file names if you wish. These can take the form if icons, butt...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Introduction

A simple file replace is not all you can do with skinning. You can also add your own artwork, with your own file names if you wish. These can take the form if icons, buttons, or backgrounds.

Adding artwork

The viewer supports files saved in PNG, TGA, or J2C formats. To add your own artwork to the viewer:

  1. Save your image in one of the following formats above, for example, foo.tga.
  2. Move foo.tga to the SecondLifeReleaseCandidate\skins\textures folder.
  3. In this folder, find and open the file textures.xml and add the following line: <foo.tga preload="true"/> anywhere between <textures> and </textures>. (Note that you can also use scale_rect values for your texture. For more information, read scale_rect).

The setting preload="true"/> ensures the texture loads on startup.

Using your artwork

To use your artwork, you need to reference it in another xml file. For example:

<icon bottom="0" left="0" scale_image="true" width="100"
         follows="left|right|top|bottom" height="26" image_name="foo.tga"/>
<button bottom="0" font="SansSerif" height="20" left="0"
	       image_selected="foo.tga" 
	       image_unselected="foo2tga" 
	       image_disabled="foo3.tga"
	       image_disabled_selected="foo4.tga"
	       image_overlay="icn_foo.tga" 
	       label="foo" name="foo" tool_tip="Show foo" 

Any combination of image_* parameters can be used for buttons, and using your texture as an icon in its own panel (as is done in panel_toolbar.xml loading panel_bg_toolbar.xml) is a way to create your own backgrounds.