public class Overlay
extends java.lang.Object
implements java.io.Serializable
Constructor and Description |
---|
Overlay(World world,
FrameBuffer buffer,
java.lang.String textureName)
Creates a new overlay that covers the whole screen.
|
Overlay(World world,
int upperLeftX,
int upperLeftY,
int lowerRightX,
int lowerRightY,
java.lang.String textureName)
Creates a new overlay of arbritary size.
|
Overlay(World world,
int upperLeftX,
int upperLeftY,
int lowerRightX,
int lowerRightY,
java.lang.String textureName,
boolean modifyUV)
Creates a new overlay of arbritary size with (optional) modifiable
uv-coordinates.
|
Modifier and Type | Method and Description |
---|---|
void |
dispose()
Disposes the overlay and frees its resources.
|
Object3D |
getObject3D()
Returns the internal Object3D that is the actual Overlay.
|
void |
setColor(RGBColor color)
Sets a new additional color.
|
void |
setDepth(float depth)
Sets the depth of the overlay.
|
void |
setInitialMatrix(Matrix matrix)
Sets a new initial matrix that will be used instead of the identity
matrix when calculating the Overlay's position.
|
void |
setNewCoordinates(int upperLeftX,
int upperLeftY,
int lowerRightX,
int lowerRightY)
Sets new coordinates for the overlay.
|
void |
setRotation(float angle)
Rotates the Overlay around it's midpoint.
|
void |
setRotationPivot(int x,
int y)
Sets the pivot point for the rotation in screen coordinates.
|
void |
setSourceCoordinates(float upperLeftX,
float upperLeftY,
float lowerRightX,
float lowerRightY)
Sets new source coordinates.
|
void |
setTexture(java.lang.String textureName)
Changes the texture of the overlay.
|
void |
setTexture(TextureInfo textureInfo)
Changes the texture of the overlay.
|
void |
setTransparency(int trans)
Set the transparency of the overlay.
|
void |
setTransparencyMode(int mode)
Sets the transparency mode similar to setTransparencyMode() in Object3D.
|
void |
setVisibility(boolean visible)
Sets the visibility similar to setVisibility() in Object3D.
|
void |
unlink()
Unlinks the overlay.
|
void |
update(FrameBuffer buffer)
Updates the overlay.
|
public Overlay(World world, FrameBuffer buffer, java.lang.String textureName)
world
- the worldbuffer
- the current frame buffertextureName
- the name of the texture that should be used as an overlay. The
TextureManager has to know this texture.public Overlay(World world, int upperLeftX, int upperLeftY, int lowerRightX, int lowerRightY, java.lang.String textureName)
world
- the worldupperLeftX
- the upper left corner's x-coordinate in screen coordinatesupperLeftY
- the upper left corner's y-coordinate in screen coordinateslowerRightX
- the lower right corner's x-coordinate in screen coordinateslowerRightY
- the lower right corner's y-coordinate in screen coordinatestextureName
- the name of the texture that should be used as an overlay. The
TextureManager has to know this texture.public Overlay(World world, int upperLeftX, int upperLeftY, int lowerRightX, int lowerRightY, java.lang.String textureName, boolean modifyUV)
world
- the worldupperLeftX
- the upper left corner's x-coordinate in screen coordinatesupperLeftY
- the upper left corner's y-coordinate in screen coordinateslowerRightX
- the lower right corner's x-coordinate in screen coordinateslowerRightY
- the lower right corner's y-coordinate in screen coordinatestextureName
- the name of the texture that should be used as an overlay. The
TextureManager has to know this texture.modifyUV
- if true, uv-coordinates can be modified.public void setDepth(float depth)
depth
- the new depth (should be positive)public void setTransparency(int trans)
trans
- the transparency valueObject3D.setTransparency(int)
public void setColor(RGBColor color)
color
- the new Colorpublic void setTexture(java.lang.String textureName)
textureName
- the new texture's name as the TextureManager knows it.public void setTexture(TextureInfo textureInfo)
textureInfo
- the new TextureInfo.public void setVisibility(boolean visible)
visible
- should it be visible or not?Object3D.setVisibility(boolean)
public void setTransparencyMode(int mode)
mode
- the modeObject3D.setTransparencyMode(int)
,
Object3D.TRANSPARENCY_MODE_DEFAULT
,
Object3D.TRANSPARENCY_MODE_ADD
public void setNewCoordinates(int upperLeftX, int upperLeftY, int lowerRightX, int lowerRightY)
upperLeftX
- the upper left corner's x-coordinate in screen coordinatesupperLeftY
- the upper left corner's y-coordinate in screen coordinateslowerRightX
- the lower right corner's x-coordinate in screen coordinateslowerRightY
- the lower right corner's y-coordinate in screen coordinatespublic void setSourceCoordinates(float upperLeftX, float upperLeftY, float lowerRightX, float lowerRightY)
upperLeftX
- the upper left corner's x-coordinate in texture coordinatesupperLeftY
- the upper left corner's y-coordinate in texture coordinateslowerRightX
- the lower right corner's x-coordinate in texture coordinateslowerRightY
- the lower right corner's y-coordinate in texture coordinatespublic void setRotation(float angle)
angle
- the anglepublic void setInitialMatrix(Matrix matrix)
matrix
- the new initial Matrixpublic void setRotationPivot(int x, int y)
x
- the x positiony
- the y positionpublic Object3D getObject3D()
public void dispose()
public void unlink()
public void update(FrameBuffer buffer)
buffer
-