com.jmex.bui.background
Class ImageBackground

java.lang.Object
  extended by com.jmex.bui.background.BBackground
      extended by com.jmex.bui.background.ImageBackground

public class ImageBackground
extends BBackground

Supports image backgrounds in a variety of ways. Specifically:


Field Summary
protected  Insets _frame
           
protected  BImage _image
           
protected  ImageBackgroundMode _mode
           
protected static int CENTER
           
protected static int FRAME
           
protected static int SCALE
           
protected static int TILE
           
 
Constructor Summary
ImageBackground(ImageBackgroundMode mode, BImage image)
          Creates an image background in the specified mode using the supplied image.
ImageBackground(ImageBackgroundMode mode, BImage image, Insets frame)
          Creates an image background in the specified mode using the supplied image and the special frame.
 
Method Summary
 int getMinimumHeight()
          Returns the minimum height allowed by this background.
 int getMinimumWidth()
          Returns the minimum width allowed by this background.
 void render(com.jme.renderer.Renderer renderer, int x, int y, int width, int height, float alpha)
          Renders this background.
protected  void renderCentered(com.jme.renderer.Renderer renderer, int x, int y, int width, int height, float alpha)
           
protected  void renderFramed(com.jme.renderer.Renderer renderer, int x, int y, int width, int height, float alpha)
           
protected  void renderRow(com.jme.renderer.Renderer renderer, int x, int y, int width, int iheight, float alpha)
           
protected  void renderScaled(com.jme.renderer.Renderer renderer, int x, int y, int width, int height, float alpha)
           
protected  void renderTiled(com.jme.renderer.Renderer renderer, int x, int y, int width, int height, float alpha)
           
 void wasAdded()
          Called when the component that contains this background is was added to the interface hierarchy.
 void wasRemoved()
          Called when the component that contains this background is no longer part of a user interface hierarchy.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_mode

protected ImageBackgroundMode _mode

_image

protected BImage _image

_frame

protected Insets _frame

CENTER

protected static final int CENTER
See Also:
Constant Field Values

SCALE

protected static final int SCALE
See Also:
Constant Field Values

TILE

protected static final int TILE
See Also:
Constant Field Values

FRAME

protected static final int FRAME
See Also:
Constant Field Values
Constructor Detail

ImageBackground

public ImageBackground(ImageBackgroundMode mode,
                       BImage image)
Creates an image background in the specified mode using the supplied image.


ImageBackground

public ImageBackground(ImageBackgroundMode mode,
                       BImage image,
                       Insets frame)
Creates an image background in the specified mode using the supplied image and the special frame. This should only be used if one of the framing modes is being used and the supplied frame will be used instead of the default frame which divides the image in thirds.

Method Detail

getMinimumWidth

public int getMinimumWidth()
Description copied from class: BBackground
Returns the minimum width allowed by this background.

Overrides:
getMinimumWidth in class BBackground
Returns:
int

getMinimumHeight

public int getMinimumHeight()
Returns the minimum height allowed by this background.

Overrides:
getMinimumHeight in class BBackground
Returns:
int

render

public void render(com.jme.renderer.Renderer renderer,
                   int x,
                   int y,
                   int width,
                   int height,
                   float alpha)
Description copied from class: BBackground
Renders this background.

Overrides:
render in class BBackground
Parameters:
renderer - Renderer
x - int
y - int
width - int
height - int
alpha - float

wasAdded

public void wasAdded()
Description copied from class: BBackground
Called when the component that contains this background is was added to the interface hierarchy.

Overrides:
wasAdded in class BBackground

wasRemoved

public void wasRemoved()
Description copied from class: BBackground
Called when the component that contains this background is no longer part of a user interface hierarchy.

Overrides:
wasRemoved in class BBackground

renderCentered

protected void renderCentered(com.jme.renderer.Renderer renderer,
                              int x,
                              int y,
                              int width,
                              int height,
                              float alpha)

renderScaled

protected void renderScaled(com.jme.renderer.Renderer renderer,
                            int x,
                            int y,
                            int width,
                            int height,
                            float alpha)

renderTiled

protected void renderTiled(com.jme.renderer.Renderer renderer,
                           int x,
                           int y,
                           int width,
                           int height,
                           float alpha)

renderRow

protected void renderRow(com.jme.renderer.Renderer renderer,
                         int x,
                         int y,
                         int width,
                         int iheight,
                         float alpha)

renderFramed

protected void renderFramed(com.jme.renderer.Renderer renderer,
                            int x,
                            int y,
                            int width,
                            int height,
                            float alpha)


Copyright © 2011 Michael Bayne. All Rights Reserved.