BenQ Mobile

javax.microedition.m3g
Class Background

java.lang.Object
  extended byjavax.microedition.m3g.Object3D
      extended byjavax.microedition.m3g.Background

public class Background
extends Object3D

Defines whether and how to clear the viewport.


Field Summary
static int BORDER
          Specifies that the imaginary pixels outside of the source image boundaries in X or Y direction are considered to have the background color.
static int REPEAT
          Specifies that the imaginary pixels outside of the source image boundaries in X or Y direction are considered to have the same color as the pixel in the corresponding position in the source image.
 
Constructor Summary
Background()
          Constructs a new Background with default values.
 
Method Summary
 int getColor()
          Retrieves the current background color.
 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 background image.
 int getImageModeX()
          Gets the current background image repeat mode for the X dimension.
 int getImageModeY()
          Gets the current background image repeat mode for the Y dimension.
 boolean isColorClearEnabled()
          Queries whether color buffer clearing is enabled.
 boolean isDepthClearEnabled()
          Queries whether depth buffer clearing is enabled.
 void setColor(int ARGB)
          Sets the background color.
 void setColorClearEnable(boolean enable)
          Enables or disables color buffer clearing.
 void setCrop(int cropX, int cropY, int width, int height)
          Sets a cropping rectangle within the background image.
 void setDepthClearEnable(boolean enable)
          Enables or disables depth buffer clearing.
 void setImage(Image2D image)
          Sets the background image, or switches from background image mode to background color mode.
 void setImageMode(int modeX, int modeY)
          Sets the background image repeat mode for the X and Y directions.
 
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
 

Field Detail

BORDER

public static final int BORDER
Specifies that the imaginary pixels outside of the source image boundaries in X or Y direction are considered to have the background color.

See Also:
Constant Field Values

REPEAT

public static final int REPEAT
Specifies that the imaginary pixels outside of the source image boundaries in X or Y direction are considered to have the same color as the pixel in the corresponding position in the source image.

See Also:
Constant Field Values
Constructor Detail

Background

public Background()
Constructs a new Background with default values.

Method Detail

setColorClearEnable

public void setColorClearEnable(boolean enable)
Enables or disables color buffer clearing.


isColorClearEnabled

public boolean isColorClearEnabled()
Queries whether color buffer clearing is enabled.


setDepthClearEnable

public void setDepthClearEnable(boolean enable)
Enables or disables depth buffer clearing.


isDepthClearEnabled

public boolean isDepthClearEnabled()
Queries whether depth buffer clearing is enabled.


setColor

public void setColor(int ARGB)
Sets the background color.


getColor

public int getColor()
Retrieves the current background color.


setImage

public void setImage(Image2D image)
Sets the background image, or switches from background image mode to background color mode.


getImage

public Image2D getImage()
Gets the current background image.


setImageMode

public void setImageMode(int modeX,
                         int modeY)
Sets the background image repeat mode for the X and Y directions.


getImageModeX

public int getImageModeX()
Gets the current background image repeat mode for the X dimension.


getImageModeY

public int getImageModeY()
Gets the current background image repeat mode for the Y dimension.


setCrop

public void setCrop(int cropX,
                    int cropY,
                    int width,
                    int height)
Sets a cropping rectangle within the background 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.