Public Member Functions
GUI::Imageset Class Reference

Offers functions to define, access, and draw, a set of image components on a single graphical surface or Texture. More...

List of all members.

Public Member Functions

Texture getTexture ()
 return Texture object for this Imageset
string getName ()
 return String object holding the name of the Imageset
int getImageCount ()
 return number of images defined for this Imageset
bool isImageDefined (string name)
 return true if an Image with the specified name exists.
Image getImage (string name)
 return a copy of the Image object for the named image
void undefineImage (string name)
 remove the definition for the Image with the specified name. If no such Image exists, nothing happens.
void undefineAllImages ()
 Removes the definitions for all Image objects currently defined in the Imageset.
Size getImageSize (string name)
 return a Size object describing the dimensions of the named image.
float getImageWidth (string name)
 return the width of the named image.
float getImageHeight (string name)
 return the height of the named image.
Point getImageOffset (string name)
 return the rendering offsets applied to the named image.
float getImageOffsetX (string name)
 return the x rendering offset for the named image.
float getImageOffsetY (string name)
 return the y rendering offset for the named image.
void defineImage (string name, Point position, Size size, Point render_offset)
 Define a new Image for this Imageset.
void defineImage (string name, Rect image_rect, Point render_offset)
 Define a new Image for this Imageset.
bool isAutoScaled ()
 Return whether this Imageset is auto-scaled.
Size getNativeResolution ()
 Return the native display size for this Imageset. This is only relevant if the Imageset is being auto-scaled.
void setAutoScalingEnabled (bool setting)
 Enable or disable auto-scaling for this Imageset.
void setNativeResolution (Size size)
 Set the native resolution for this Imageset.
void notifyScreenResolution (Size size)
 Notify the Imageset of the current (usually new) display resolution.
void setDefaultResourceGroup (string resourceGroup)
 Sets the default resource group to be used when loading imageset data.
string getDefaultResourceGroup ()
 Returns the default resource group currently set for Imagesets.

Qualified Iterators

Image Image
 Can be used to iterate over the Image objects in the Imageset.

Detailed Description

Offers functions to define, access, and draw, a set of image components on a single graphical surface or Texture.

Imageset objects are a means by which a single graphical image (file, Texture, etc), can be split into a number of 'components' which can later be accessed via name. The components of an Imageset can queried for various details, and sent to the Renderer object for drawing.


Member Function Documentation

Texture GUI::Imageset::getTexture ( )

return Texture object for this Imageset

Returns:
Texture object that holds the imagery for this Imageset
string GUI::Imageset::getName ( )

return String object holding the name of the Imageset

Returns:
String object that holds the name of the Imageset.
int GUI::Imageset::getImageCount ( )

return number of images defined for this Imageset

Returns:
int value equal to the number of Image objects defined for the Imageset
bool GUI::Imageset::isImageDefined ( string  name)

return true if an Image with the specified name exists.

Parameters:
nameString object holding the name of the Image to look for.
Returns:
true if an Image object named name is defined for this Imageset, else false.
Image GUI::Imageset::getImage ( string  name)

return a copy of the Image object for the named image

Parameters:
nameString object holding the name of the Image object to be returned
Returns:
constant Image object that has the requested name.
Exceptions:
UnknownObjectExceptionthrown if no Image named name is defined for the Imageset
void GUI::Imageset::undefineImage ( string  name)

remove the definition for the Image with the specified name. If no such Image exists, nothing happens.

Parameters:
nameString object holding the name of the Image object to be removed from the Imageset,
Returns:
Nothing.
void GUI::Imageset::undefineAllImages ( )

Removes the definitions for all Image objects currently defined in the Imageset.

Returns:
Nothing
Size GUI::Imageset::getImageSize ( string  name)

return a Size object describing the dimensions of the named image.

Parameters:
nameString object holding the name of the Image.
Returns:
Size object holding the dimensions of the requested Image.
Exceptions:
UnknownObjectExceptionthrown if no Image named name is defined for the Imageset
float GUI::Imageset::getImageWidth ( string  name)

return the width of the named image.

Parameters:
nameString object holding the name of the Image.
Returns:
float value equalling the width of the requested Image.
Exceptions:
UnknownObjectExceptionthrown if no Image named name is defined for the Imageset
float GUI::Imageset::getImageHeight ( string  name)

return the height of the named image.

Parameters:
nameString object holding the name of the Image.
Returns:
float value equalling the height of the requested Image.
Exceptions:
UnknownObjectExceptionthrown if no Image named name is defined for the Imageset
Point GUI::Imageset::getImageOffset ( string  name)

return the rendering offsets applied to the named image.

Parameters:
nameString object holding the name of the Image.
Returns:
Point object that holds the rendering offsets for the requested Image.
Exceptions:
UnknownObjectExceptionthrown if no Image named name is defined for the Imageset
float GUI::Imageset::getImageOffsetX ( string  name)

return the x rendering offset for the named image.

Parameters:
nameString object holding the name of the Image.
Returns:
float value equal to the x rendering offset applied when drawing the requested Image.
Exceptions:
UnknownObjectExceptionthrown if no Image named name is defined for the Imageset
float GUI::Imageset::getImageOffsetY ( string  name)

return the y rendering offset for the named image.

Parameters:
nameString object holding the name of the Image.
Returns:
float value equal to the y rendering offset applied when drawing the requested Image.
Exceptions:
UnknownObjectExceptionthrown if no Image named name is defined for the Imageset
void GUI::Imageset::defineImage ( string  name,
Point  position,
Size  size,
Point  render_offset 
)

Define a new Image for this Imageset.

Parameters:
nameString object holding the name that will be assigned to the new Image, which must be unique within the Imageset.
positionPoint object describing the pixel location of the Image on the image file / texture associated with this Imageset.
sizeSize object describing the dimensions of the Image, in pixels.
render_offsetPoint object describing the offsets, in pixels, that are to be applied to the Image when it is drawn.
Returns:
Nothing
Exceptions:
AlreadyExistsExceptionthrown if an Image named name is already defined for this Imageset
void GUI::Imageset::defineImage ( string  name,
Rect  image_rect,
Point  render_offset 
)

Define a new Image for this Imageset.

Parameters:
nameString object holding the name that will be assigned to the new Image, which must be unique within the Imageset.
image_rectRect object describing the area on the image file / texture associated with this Imageset that will be used for the Image.
render_offsetPoint object describing the offsets, in pixels, that are to be applied to the Image when it is drawn.
Returns:
Nothing
Exceptions:
AlreadyExistsExceptionthrown if an Image named name is already defined for this Imageset
bool GUI::Imageset::isAutoScaled ( )

Return whether this Imageset is auto-scaled.

Returns:
true if Imageset is auto-scaled, false if not.
Size GUI::Imageset::getNativeResolution ( )

Return the native display size for this Imageset. This is only relevant if the Imageset is being auto-scaled.

Returns:
Size object describing the native display size for this Imageset.
void GUI::Imageset::setAutoScalingEnabled ( bool  setting)

Enable or disable auto-scaling for this Imageset.

Parameters:
settingtrue to enable auto-scaling, false to disable auto-scaling.
Returns:
Nothing.
void GUI::Imageset::setNativeResolution ( Size  size)

Set the native resolution for this Imageset.

Parameters:
sizeSize object describing the new native screen resolution for this Imageset.
Returns:
Nothing
void GUI::Imageset::notifyScreenResolution ( Size  size)

Notify the Imageset of the current (usually new) display resolution.

Parameters:
sizeSize object describing the display resolution
Returns:
Nothing
void GUI::Imageset::setDefaultResourceGroup ( string  resourceGroup)

Sets the default resource group to be used when loading imageset data.

Parameters:
resourceGroupString describing the default resource group identifier to be used.
Returns:
Nothing.
string GUI::Imageset::getDefaultResourceGroup ( )

Returns the default resource group currently set for Imagesets.

Returns:
String describing the default resource group identifier that will be used when loading Imageset data.

Member Data Documentation

Image GUI::Imageset::Image

Can be used to iterate over the Image objects in the Imageset.

for each Image i in imageset {
trace(i.getName());
}