INFO
|
|
You can create shapes like squares, frames, lines, rings, triangles, circles, octagons etc. on the fly. These shapes are simple low polygon meshes that do not require any textures. You can rotate, move and scale them, add shadows or colorize them like any other object. With many shapes, you can set a custom line width, too.
Shapes can be used on every layer, regardless of the texture you attached to it.
|
|
SHAPE COMMANDS
|
|
|
HUD_CreateShape
|
|
|
ShapeHandle% =
HUD_CreateShape (
Layer_Handle%,
type$,
param1%,
param2%,
x%,
y%,
width%,
height%,
[xAlign$],
[yAlign$],
[zOrder%]
)
|
This will create a shape and return a handle to it. A shape can be set to any color using HUD_SetObjectColor( ) then. You can also add a drop shadow to a shape using HUD_SetObjectShadow( ).
Layer_Handle%
The handle of a layer where the shape should be created on.
type$
Set this parameter to one of the following values to create different shape types. Depending of the kind of shape you create, the parameters param1% and param2% will have different purposes.
|
"RECTANGLE"
|
|
param1: 0 = Outlined, 1 = Filled
param2: Line thickness (when outlined only)
|
|
"TRIANGLE"
|
|
param1: 0 = Outlined, 1 = Filled
param2: Line thickness (when outlined only)
|
|
"RING"
|
|
param1: Number of segments or sides
param2: Line thickness
|
|
"DOTRING"
|
|
param1: Number of segments (number of dots / dashes will be number of segments / 2)
param2: Line thickness
|
"CIRCLE" (16 segments)
|
|
param1: Number of segments or sides
param2: Unused (use 0)
|
"CIRCLE" (8 segments)
|
|
Example of a circle with 8 segments only.
|
|
"LINE"
|
|
param1: Line thickness
param2: Unused (use 0)
|
|
"STAR"
|
|
param1: Number of peaks
param2: Unused (use 0)
|
|
"HOLLOWSTAR"
|
|
param1: Number of peaks
param2: Line thickness
|
|
"PERCENTBAR"
|
|
param1: Percent to display (0 - 100)
param2: Outline thickness
|
x% , y%
The x- and y-coordinates where the shape should be placed. The mesh origin of a shape is always the center, so keep in mind that the shape will be placed at the specified position, using it's center point.
When creating a line, these two parameters will specify the x- and y- coordinate of the line's start position.
width%, height%
The width and height of the shape to create, in pixels. By using different width and height values for circles, you can also create ovals, for example.
When creating a line, these two parameters will specify the x- and y- coordinate of the line's end position.
xAlign$
" " (empty) - The specified x-coordinate will be used to position the object.
"LEFT" - Object will be placed at the left screen border, regardless to the current screen resolution.
"CENTER" - Object will be centered on screen horizontally, regardless to the current screen resolution.
"RIGHT" - Object will be placed at the right screen border, regardless to the current screen resolution.
Hint: You can also use offsets: "CENTER+50" or "RIGHT-25", for example!
yAlign$
" " (empty) - The specified y-coordinate will be used to position the object.
"TOP" - Object will be placed at the top screen border, regardless to the current screen resolution.
"CENTER" - Object will be centered on screen vertically, regardless to the current screen resolution.
"BOTTOM" - Object will be placed at the bottom screen border, regardless to the current screen resolution.
Hint: You can also use offsets: "CENTER+50" or "BOTTOM-50", for example!
zOrder%
The depth order of this object. When not specified, a new object will be placed on top of existing ones. An object's depth order can be changed at any time. Use values from 0 to ... , where higher values will place it on top of other objects and lower values will place it behind other objects.
|
|
HUD_UpdateShape
|
|
|
HUD_UpdateShape (
ShapeHandle%,
type$,
param1%,
param2%,
x%,
y%,
width%,
height%,
[xAlign$],
[yAlign$]
)
|
Same command as above, but using this one you can modify an already existing shape (resize the shape, or change a triangle into a rectangle, re-drawing a line, for example). This command does not return a new handle since it modifies an existing shape mesh.
|
©2004,2005 Mike Dogan / X-PRESSIVE.COM
X-PRESSIVE.COM is a label and working title of Mike Dogan, est. 1999
All artwork, including graphics, text, images and sounds are property of Mike Dogan, X-PRESSIVE.COM. Trademarks belong to their respective owners. All rights reserved.
|