State Presentation

(Difference between revisions)
Jump to: navigation, search
(added redirect to Gui_editor#Presentation_States)
Line 1: Line 1:
#REDIRECT [[Gui_editor#Presentation_States]]
= State Presentation and [[Technical:GUI|GUI]] Control Textures =
= State Presentation and [[Technical:GUI|GUI]] Control Textures =

Revision as of 21:48, 10 November 2011

  1. REDIRECT Gui_editor#Presentation_States


State Presentation and GUI Control Textures

See also:


State presentation basically means how the texture of a particular window or GUI Control is handled. For example, a button may have a green mottled texture. Then that texture may need to be modified depending on different conditions. Such as, when the mouse hovers over that button, the texture should perhaps be tinted yellow. When the button is clicked, perhaps the texture should be tinted red or made larger. Each of these is called a different "state" that the Control can be in.

The Texture Graphic

A texture is a graphic which is usually a tiny fragment of a much larger texture file which has multiple graphics within it. For example, imagine a patchwork quilt with 100 different panels. Some of them might be abstract, and some might be specific graphics, such as each panel of the quilt having an image of an arrow pointing in a different direction. So a script could specify, "I want the texture that's in the top row, third from the left," and then only that part of the pattern would be used. Then once the base texture was chosen, it could be further modified, by tinting it different colors, changing its brightness or opacity, or modifying some other property so that multiple results could be derived from that one section of the quilt.

Development Note: When a desired texture is copied from the larger "quilt" texture file, this is done by specifying the exact location, in pixels, of the needed texture. Eventually there will probably be a TextureViewer utility which will allow for examining different texture files, and choosing the exact section that is needed. However, as of this writing, the only practical way to choose a texture is to look at existing GUI Controls, and copy the coordinates and texture file from something that already has the desired graphic. (is this still accurate?)

Details on setting the state presentation

The GUIControl class has various fields which are used for configuring the different kinds of State Presentations. All of them are optional, except for the default:

Each of the above GUIControl fields is of the uv class, which includes subclasses of color, position, and size. See the GUIControls page for details on their subfields.

Choosing a texture

The State Presentation position and size classes are used to indicate the coordinates of a texture, from the optional file specified in the GUIControl's texture field. position specifies the top left corner of the rectangle within the texture "quilt" file, and size indicates how large the rectangle should be.

Setting a texture's tint

The values of the State Presentation color subclass are multiplied against the texture's own colors, to give it a tint, lighten or darken it, or change its opacity. Setting the color.r,g,b values lower makes the image darker. Usually, however, it is probably best to just leave them at their default values.

Setting a texture's opacity

Setting color.a (alpha) to a lower value makes it more transparent.

Personal tools