|
![]() |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.siemens.mp.misc.NativeMem
com.siemens.mp.game.GraphicObjectManager
The GraphicObjectManager implements graphic object collections.
It holds GraphicObject
class objects and their descendants, such as
Sprite
and
TiledBackground
.
GraphicObjectManager provides functionality for managing
objects in a collection (insertion, deletion, search) and drawing
an entire collection of graphic objects (layer by layer, from first
to last object) on a given Image
or ExtendedImage
object.
GraphicObject
,
Sprite
,
TiledBackground
Constructor Summary | |
GraphicObjectManager()
Initializes GraphicObjectManager. |
Method Summary | |
void |
addObject(GraphicObject gobject)
Adds a new GraphicObject
to the collection at the end of its list of objects.
|
static byte[] |
createTextureBits(int width,
int height,
byte[] texture)
Converts a texture from byte per pixel into bit per pixel representation. |
void |
deleteObject(GraphicObject gobject)
Removes the specified GraphicObject from the collection.
|
void |
deleteObject(int position)
Removes from a collection the GraphicObject
specified by its position in the list.
|
GraphicObject |
getObjectAt(int index)
Returns the GraphicObject at the specified position in the list. |
int |
getObjectPosition(GraphicObject gobject)
Returns the specified GraphicObject 's position
in the list. |
void |
insertObject(GraphicObject gobject,
int position)
Inserts a new GraphicObject
into the collection at the specified position. |
void |
paint(ExtendedImage eimage,
int x,
int y)
Draws all objects in the collection on the specified ExtendedImage .
|
void |
paint(Image image,
int x,
int y)
Draws all objects in the collection on the specified offscreen image. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public GraphicObjectManager()
Method Detail |
public void addObject(GraphicObject gobject)
GraphicObject
to the collection at the end of its list of objects.
On paint
method call, the entire collection will be drawn in order, from
the first to the last element (like layers).
gobject
- the GraphicObject
to add
public void insertObject(GraphicObject gobject, int position)
GraphicObject
into the collection at the specified position. It shifts up the object that
previously occupied that position, and all the subsequent objects.
On paint
method call, the entire collection will be drawn from the first to the last
element (like layers).
gobject
- the GraphicObject
to insertposition
- the position at which this object is to be inserted (0 for the first object)
public int getObjectPosition(GraphicObject gobject)
GraphicObject
's position
in the list.
gobject
- the GraphicObject
public GraphicObject getObjectAt(int index)
GraphicObject
at the specified position in the list.
index
- the position in the list (0 for the first object)
GraphicObject
at the specified position
public void deleteObject(GraphicObject gobject)
GraphicObject
from the collection.
All the subsequent objects (if any) are shifted down.
gobject
- the GraphicObject
to remove
public void deleteObject(int position)
GraphicObject
specified by its position in the list.
All the subsequent objects (if any) are shifted down.
position
- the position of the object to remove (0 for the first object)
public void paint(Image image, int x, int y) throws IllegalArgumentException
image
- a standard Image
(without transparency)x
- the x coordinate of the drawing area starting point (relative to the image)y
- the y coordinate of the drawing area starting point (relative to the image)
IllegalArgumentException
- if an image with transparent color is used
public void paint(ExtendedImage eimage, int x, int y) throws IllegalArgumentException
ExtendedImage
.
Objects will be drawn from the first to the last one (like layers).
eimage
- an ExtendedImage
(without transparency)x
- the x coordinate of the drawing area starting point (relative to the image)y
- the y coordinate of the drawing area starting point (relative to the image)
IllegalArgumentException
- if an image with transparent color is used
public static byte[] createTextureBits(int width, int height, byte[] texture)
GraphicObject
descendants (such as Sprite
and
TiledBackground
) and of other
objects (such as Image
and
ExtendedImage
)
Example of converting texture representation: The source byte per pixel array: { 0,0,0,0,0,0,0,0, 0,0,1,1,1,1,0,0, 1,1,1,1,1,0,0,0, } The resulting bit per pixel array (complement of two): { 0, 60, -8, }
width
- the width of the texture in pixelsheight
- the height of the texture in pixelstexture
- the source byte per pixel array
|
![]() |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Generated on 2003-10-17 | For further information and updates, please visit Siemens mobile Developer Portal |