Torque 3D - Script Manual: GuiBitmapCtrl Class Reference

TorqueScript

Main   Class List   Namespace List   Online

GuiBitmapCtrl Class Reference
[General Controls]

A gui control that is used to display an image. More...

Inheritance diagram for GuiBitmapCtrl:

List of all members.

Public Member Functions

void setBitmap (String filename, bool resize)
 Assign an image to the control.
void setBitmap (String filename)
 Assign an image to the control.
void setValue (int x, int y)
 Set the offset of the bitmap within the control.

Public Attributes

Bitmap

filename bitmap
 The bitmap file to display in the control.
bool wrap
 If true, the bitmap is tiled inside the control rather than stretched to fit.

Detailed Description

A gui control that is used to display an image.

The image is stretched to the constraints of the control by default. However, the control can also tile the image as well.

The image itself is stored inside the GuiBitmapCtrl::bitmap field. The boolean value that decides whether the image is stretched or tiled is stored inside the GuiBitmapCtrl::wrap field.

Example:
// Create a tiling GuiBitmapCtrl that displays "myImage.png"
%bitmapCtrl = new GuiBitmapCtrl()
{
   bitmap = "myImage.png";
   wrap = "true";
};

Member Function Documentation

void GuiBitmapCtrl::setBitmap ( String  filename,
bool  resize 
)

Assign an image to the control.

Child controls with resize according to their layout settings.

Parameters:
filename The filename of the image.
resize Optional parameter. If true, the GUI will resize to fit the image.
void GuiBitmapCtrl::setBitmap ( String  filename  ) 

Assign an image to the control.

Child controls will resize according to their layout settings.

Parameters:
filename The filename of the image.
resize A boolean value that decides whether the ctrl refreshes or not.
void GuiBitmapCtrl::setValue ( int  x,
int  y 
)

Set the offset of the bitmap within the control.

Parameters:
x The x-axis offset of the image.
y The y-axis offset of the image.

Member Data Documentation

The bitmap file to display in the control.

If true, the bitmap is tiled inside the control rather than stretched to fit.



Copyright © GarageGames, LLC. All Rights Reserved.