espresso3d.engine.viewport.image
Class E3DVariableSizeImage

java.lang.Object
  extended byespresso3d.engine.base.E3DEngineItem
      extended byespresso3d.engine.renderer.base.E3DRenderable
          extended byespresso3d.engine.renderer.base.E3DTexturedRenderable
              extended byespresso3d.engine.renderer.base.E3DAnimatedTextureRenderable
                  extended byespresso3d.engine.viewport.image.E3DImage
                      extended byespresso3d.engine.viewport.image.E3DVariableSizeImage

public class E3DVariableSizeImage
extends E3DImage

Author:
Curt A variable size image will scale itself to be the size to always fill the same amount of space in the viewport no matter how large or small it gets.

Constructor Summary
E3DVariableSizeImage(E3DEngine engine, java.lang.String imageID, E3DAnimatedTextureFrame[] animatedTextureFrames, int animationLoops, E3DVector2I position, double widthPercentage, double heightPercentage, int life)
          Create a variable size image that has an animated texture
E3DVariableSizeImage(E3DEngine engine, java.lang.String imageID, E3DAnimatedTextureFrame[] animatedTextureFrames, int animationLoops, E3DVector2I position, double widthPercentage, double heightPercentage, int life, int blendMode)
          Create a variable size image that has an animated texture
E3DVariableSizeImage(E3DEngine engine, java.lang.String imageID, java.lang.String textureName, E3DVector2I position, double widthPercentage, double heightPercentage, int life)
          Construct an E3DImage that has a percentage height and width.
E3DVariableSizeImage(E3DEngine engine, java.lang.String imageID, java.lang.String textureName, E3DVector2I position, double widthPercentage, double heightPercentage, int life, int blendMode)
          Construct an E3DImage that has a percentage height and width.
E3DVariableSizeImage(E3DVariableSizeImage toCopyImage, java.lang.String imageID)
          Create this image as a copy of another, only giving it different ID
 
Method Summary
 E3DQuad getPositionedQuad()
          Returns a quad in 3D space that is positioned correctly to be rendered in the correct position for 2D space Usually used only by the engine.
 void scale(double scaleAmt)
          Scale the widthPercentage and heightPercentage by scaleAmt
 
Methods inherited from class espresso3d.engine.viewport.image.E3DImage
getAge, getImageID, getLife, getPosition, getQuad, getViewport, render, setImageID, setLife, setPosition, setQuad, setVertexColor, setViewport, translate, update
 
Methods inherited from class espresso3d.engine.renderer.base.E3DAnimatedTextureRenderable
getAnimatedTexture, setAnimatedTexture
 
Methods inherited from class espresso3d.engine.renderer.base.E3DTexturedRenderable
getKey, getTexture, getTextureDetail0, getTextureDetail1, isTextureAvailable, isTextureDetail0Available, isTextureDetail1Available, setTexture, setTextureDetail0, setTextureDetail1
 
Methods inherited from class espresso3d.engine.renderer.base.E3DRenderable
getBlendMode, getRenderMode, initCorrectGeometryRenderer, isKeyChanged, setBlendMode, setKeyChanged, setRenderMode
 
Methods inherited from class espresso3d.engine.base.E3DEngineItem
getEngine, setEngine
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

E3DVariableSizeImage

public E3DVariableSizeImage(E3DEngine engine,
                            java.lang.String imageID,
                            java.lang.String textureName,
                            E3DVector2I position,
                            double widthPercentage,
                            double heightPercentage,
                            int life)
Construct an E3DImage that has a percentage height and width. That means as the viewport scales, the image will always scale with it. This defaults the blendMode of the image to BLENDMODE_SOLID

Parameters:
engine -
imageID -
textureName -
position - The position the bottom left corner of the image is at in the viewport. (0,0) starts in the bottom left corner of the viewport and extends up and to the right.

E3DVariableSizeImage

public E3DVariableSizeImage(E3DEngine engine,
                            java.lang.String imageID,
                            java.lang.String textureName,
                            E3DVector2I position,
                            double widthPercentage,
                            double heightPercentage,
                            int life,
                            int blendMode)
Construct an E3DImage that has a percentage height and width. That means as the viewport scales, the image will always scale with it.

Parameters:
engine -
imageID -
textureName -
position - The position the bottom left corner of the image is at in the viewport. (0,0) starts in the bottom left corner of the viewport and extends up and to the right.
blendMode - The type of blending that should be used to render the object

E3DVariableSizeImage

public E3DVariableSizeImage(E3DVariableSizeImage toCopyImage,
                            java.lang.String imageID)
Create this image as a copy of another, only giving it different ID

Parameters:
toCopyImage - The image to copy
imageID - A new unique imageID for this image

E3DVariableSizeImage

public E3DVariableSizeImage(E3DEngine engine,
                            java.lang.String imageID,
                            E3DAnimatedTextureFrame[] animatedTextureFrames,
                            int animationLoops,
                            E3DVector2I position,
                            double widthPercentage,
                            double heightPercentage,
                            int life,
                            int blendMode)
Create a variable size image that has an animated texture

Parameters:
engine -
imageID - Uniue imageID for this image
animatedTextureFrames - Array of E3DAnimatedTextureFrame objects. Each specifying a frame of the animation for the image.
animationLoops - Number of loops to animate the image
position - 2D position (Viewport coords with (0,0) at the bottom left of the viewport)
widthPercentage - Percentage of the viewport the image should fill width-wise
heightPercentage - Percentage of the viewport the image should fill height-wise
life - How long it is displayed. -1 is infinite
blendMode - One of E3DImage.RENDERMODE_ options

E3DVariableSizeImage

public E3DVariableSizeImage(E3DEngine engine,
                            java.lang.String imageID,
                            E3DAnimatedTextureFrame[] animatedTextureFrames,
                            int animationLoops,
                            E3DVector2I position,
                            double widthPercentage,
                            double heightPercentage,
                            int life)
Create a variable size image that has an animated texture

Parameters:
engine -
imageID - Uniue imageID for this image
animatedTextureFrames - Array of E3DAnimatedTextureFrame objects. Each specifying a frame of the animation for the image.
animationLoops - Number of loops to animate the image
position - 2D position (Viewport coords with (0,0) at the bottom left of the viewport)
widthPercentage - Percentage of the viewport the image should fill width-wise
heightPercentage - Percentage of the viewport the image should fill height-wise
life - How long it is displayed. -1 is infinite
Method Detail

getPositionedQuad

public E3DQuad getPositionedQuad()
Returns a quad in 3D space that is positioned correctly to be rendered in the correct position for 2D space Usually used only by the engine.

Specified by:
getPositionedQuad in class E3DImage
Returns:

scale

public void scale(double scaleAmt)
Scale the widthPercentage and heightPercentage by scaleAmt

Specified by:
scale in class E3DImage
Parameters:
scaleAmt -