BenQ Mobile

javax.microedition.m3g
Class Sprite3D

java.lang.Object
  extended byjavax.microedition.m3g.Object3D
      extended byjavax.microedition.m3g.Transformable
          extended byjavax.microedition.m3g.Node
              extended byjavax.microedition.m3g.Sprite3D

public class Sprite3D
extends Node

A scene graph node that represents a 2-dimensional image with a 3D position. Sprite3D is a fast, but functionally restricted alternative to textured geometry. A Sprite3D is rendered as a screen-aligned rectangular array of pixels with a constant depth. The apparent size of a sprite may be specified directly in pixels (an unscaled sprite) or indirectly using the transformation from the Sprite3D node to the camera space (a scaled sprite).


Field Summary
 
Fields inherited from class javax.microedition.m3g.Node
NONE, ORIGIN, X_AXIS, Y_AXIS, Z_AXIS
 
Constructor Summary
Sprite3D(boolean scaled, Image2D image, Appearance appearance)
          Constructs a new Sprite3D with the given scaling mode, image and appearance.
 
Method Summary
 Appearance getAppearance()
          Gets the current Appearance of this Sprite3D.
 int getCropHeight()
          Gets the current cropping rectangle height within the source image.
 int getCropWidth()
          Gets the current cropping rectangle width within the source image.
 int getCropX()
          Retrieves the current cropping rectangle X offset relative to the source image top left corner.
 int getCropY()
          Retrieves the current cropping rectangle Y offset relative to the source image top left corner.
 Image2D getImage()
          Gets the current Sprite3D image.
 boolean isScaled()
          Returns the automatic scaling status of this Sprite3D.
 void setAppearance(Appearance appearance)
          Sets the Appearance of this Sprite3D.
 void setCrop(int cropX, int cropY, int width, int height)
          Sets a cropping rectangle within the source image.
 void setImage(Image2D image)
          Sets the sprite image to display.
 
Methods inherited from class javax.microedition.m3g.Node
align, getAlphaFactor, getParent, getScope, getTransformTo, isPickingEnabled, isRenderingEnabled, setAlignment, setAlphaFactor, setPickingEnable, setRenderingEnable, setScope
 
Methods inherited from class javax.microedition.m3g.Transformable
getCompositeTransform, getOrientation, getScale, getTransform, getTranslation, postRotate, preRotate, scale, setOrientation, setScale, setTransform, setTranslation, translate
 
Methods inherited from class javax.microedition.m3g.Object3D
addAnimationTrack, animate, duplicate, find, getAnimationTrack, getAnimationTrackCount, getReferences, getUserID, getUserObject, removeAnimationTrack, setUserID, setUserObject
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Sprite3D

public Sprite3D(boolean scaled,
                Image2D image,
                Appearance appearance)
Constructs a new Sprite3D with the given scaling mode, image and appearance.

Method Detail

isScaled

public boolean isScaled()
Returns the automatic scaling status of this Sprite3D.


setAppearance

public void setAppearance(Appearance appearance)
Sets the Appearance of this Sprite3D.


getAppearance

public Appearance getAppearance()
Gets the current Appearance of this Sprite3D.


setImage

public void setImage(Image2D image)
Sets the sprite image to display.


getImage

public Image2D getImage()
Gets the current Sprite3D image.


setCrop

public void setCrop(int cropX,
                    int cropY,
                    int width,
                    int height)
Sets a cropping rectangle within the source image.


getCropX

public int getCropX()
Retrieves the current cropping rectangle X offset relative to the source image top left corner.


getCropY

public int getCropY()
Retrieves the current cropping rectangle Y offset relative to the source image top left corner.


getCropWidth

public int getCropWidth()
Gets the current cropping rectangle width within the source image.


getCropHeight

public int getCropHeight()
Gets the current cropping rectangle height within the source image.


BenQ Mobile

Copyright © 2006 BenQ Mobile GmbH & Co. OHG or respective copyright owner.
All Rights Reserved.
BenQ Corp. is a trademark licensee of Siemens AG.


For further information about Mobility Toolkit (MTK) visit our Developer Portal.