Skinning How To/Add custom artwork to the viewer
< Skinning How To
Jump to navigation
Jump to search
Revision as of 22:16, 30 November 2023 by EnCore Mayne (talk | contribs)
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:
- Save your image in one of the formats listed above. For example, foo.tga.
- Move foo.tga to the SecondLifeReleaseCandidate\skins\[SKIN]\textures folder, [SKIN] being the name of the viewer skin you want to add your artwork to.
- In the textures 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" follows="left|right|top|bottom" height="26" image_name="foo.tga" left="0" scale_image="true" width="100" />
or
<button bottom="0" font="SansSerif" height="20" image_disabled="foo3.tga" image_disabled_selected="foo4.tga" image_overlay="icn_foo.tga" image_selected="foo.tga" image_unselected="foo2tga" label="foo" left="0" 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 is an easy way to create your own backgrounds for UI elements.