PDG engine v0.9.5
 All Classes Namespaces Functions Variables Groups Pages
Public Member Functions | List of all members
ImageStrip Class Reference

bitmap image containing a number of frames that can be blitted onto the screen More...

Inheritance diagram for ImageStrip:
Inheritance graph
[legend]
Collaboration diagram for ImageStrip:
Collaboration graph
[legend]

Public Member Functions

Image getFrame (int frameNum)
 get image that is a single frame of this multi-frame image More...
 
number getFrameWidth ()
 get the width in pixels of a single frame of this image More...
 
number getNumFrames ()
 how many frames in this multi-frame image More...
 
ImageStrip setFrameWidth (int inFrameWidth)
 set the width in pixels of a single frame of this image More...
 
ImageStrip setNumFrames (int inNumFrames)
 set the number of frames that are in this image strip More...
 
- Public Member Functions inherited from Image
number getAlphaValue (Point p)
 get the value for the alpha channel at the given point in the image More...
 
number getAlphaValue (int x, int y)
 get the value for the alpha channel at the given x, y coordinates in the image More...
 
number getHeight ()
 get the height in pixels of the image More...
 
Rect getImageBounds (Point at)
 get image boundary rect, optionally with top left at given point More...
 
number getOpacity ()
 get opacity of this image More...
 
Color getPixel (Point p)
 get the pixel data at the given point in the image More...
 
Color getPixel (int x, int y)
 get the pixel data at the given x, y coordinates in the image More...
 
Image getSubsection (Quad quad)
 get image that is an arbitrary subsection of this image More...
 
Image getSubsection (Rect quad)
 get image that is a rectangular subsection of this image More...
 
Color getTransparentColor ()
 get the color that is used to indicate transparency More...
 
number getWidth ()
 get the width in pixels of the image More...
 
number prepareToRasterize ()
 bind the image into an OpenGL texture and free image data from main memory More...
 
 retainAlpha ()
 retain alpha data for use by Image.getAlphaValue() or per-pixel sprite collisions More...
 
 retainData ()
 retain pixel data for use by Image.getPixel() More...
 
 setEdgeClamping (boolean inUseEdgeClamp)
 set whether image uses edge clamping or not More...
 
 setOpacity (number opacity)
 set opacity of this image More...
 
Image setTransparentColor (Color inTransparentColor)
 set the color that is used to indicate transparency More...
 

Detailed Description

bitmap image containing a number of frames that can be blitted onto the screen

Note
API Stability: 2 - Unstable. The API is in the process of settling, but has not yet had sufficient real-world testing to be considered stable. Backwards-compatibility will be maintained if reasonable.

You can create an image strip directly from a file, or by loading it from resource files with the ResourceManager.

Member Function Documentation

getFrame ( int  frameNum)

get image that is a single frame of this multi-frame image

Returns
a new Image object with the sub image
Note
this is done by referencing the original, the storage space is not duplicated
Parameters
frameNumwhich frame of the multiframe image to extract
getFrameWidth ( )

get the width in pixels of a single frame of this image

Returns
the width in pixels
Note
there is no getFrameHeight() method since frames are arranged horizontally in an image strip, so the frame height is the same as the image height.
See Also
getHeight()
getWidth()
getNumFrames ( )

how many frames in this multi-frame image

Frames are arranged horizontally within an ImageStrip, so this is the same as setting the number of horizontal slices the image is divided into, one frame per slice, like a filmstrip.

Returns
the number of frames
See Also
setNumFrames()
setFrameWidth()
setFrameWidth ( int  inFrameWidth)

set the width in pixels of a single frame of this image

Returns
the width in pixels
Note
there is no setFrameHeight() method since frames are arranged horizontally in an image strip, so the frame height is the same as the image height.
this is an alternative to setNumFrames(), for use when it is more convenient to set the width rather than the frame count. You can call either one to set up an ImageStrip's frames.
See Also
setNumFrames()
getFrameHeight()
setNumFrames ( int  inNumFrames)

set the number of frames that are in this image strip

The frames are all in a horizontal row within the image strip, and this makes the frame width be the total width divided by number of frames

Parameters
inNumFramesthe total number of frames across
Note
this is an alternative to setFrameWidth(), for use when it is more convenient to set the frame count rather than the width. You can call either one to set up an ImageStrip's frames.
See Also
setFrameWidth()
getNumFrames()
getFrameWidth()

User Comments