|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.threed.jpct.util.Overlay
public class Overlay
Overlay is a helper class to create opaque or transparent screen overlays from textures. An overlay is quite similar to scaled blit with the exception that an overlay has an actual depth and that it takes care of itself, i.e. once created, it will appear automatically until you dispose it. A scaled blit has to be applied by the application each frame.
Constructor Summary | |
---|---|
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. |
Method Summary | |
---|---|
void |
dispose()
Disposes the overlay and frees its resources. |
void |
setColor(RGBColor color)
Sets a new additional color. |
void |
setDepth(float depth)
Sets the depth of the overlay. |
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 |
setSourceCoordinates(int upperLeftX,
int upperLeftY,
int lowerRightX,
int 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. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
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.Method Detail |
---|
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(int upperLeftX, int upperLeftY, int lowerRightX, int 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 dispose()
public void unlink()
public void update(FrameBuffer buffer)
buffer
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |