|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.ctdp.rfdynhud.render.TransformableTexture
public class TransformableTexture
The TransformableTexture
keeps one TextureImage2D
and transformation parameters.
Nested Class Summary | |
---|---|
static class |
TransformableTexture.Rectangle
|
Field Summary | |
---|---|
static boolean |
DEFAULT_PIXEL_PERFECT_POSITIONING
|
static int |
MAX_NUM_TEXTURES
|
static float |
PI
|
static float |
PI_HALF
|
static int |
STRUCT_SIZE
|
static float |
TWO_PI
|
Constructor Summary | |
---|---|
TransformableTexture(int width,
int height)
|
|
TransformableTexture(int width,
int height,
boolean pixelPerfectPositioning,
boolean usePowerOfTwoSizes)
|
|
TransformableTexture(int width,
int height,
boolean pixelPerfectPositioning,
float transX,
float transY,
int rotCenterX,
int rotCenterY,
float rotation,
float scaleX,
float scaleY,
boolean usePowerOfTwoSizes)
|
|
TransformableTexture(int width,
int height,
int transX,
int transY,
int rotCenterX,
int rotCenterY,
float rotation,
float scaleX,
float scaleY,
boolean usePowerOfTwoSizes)
|
Method Summary | |
---|---|
static java.nio.ByteBuffer |
createByteBuffer()
|
void |
drawInEditor(java.awt.Graphics2D texCanvas,
java.awt.geom.AffineTransform at,
Rect2i transformedRect)
|
protected int |
fillBuffer(boolean widgetVisibility,
int offsetX,
int offsetY,
int index,
int rectangleIndex,
java.nio.ByteBuffer buffer)
|
protected void |
generateRectanglesForOneBigTexture(LiveGameData gameData,
boolean isEditorMode,
WidgetsConfiguration widgetsConfig)
|
Rect2i |
getClipRect(Rect2i r)
|
java.nio.ByteBuffer |
getDirtyRectsBuffer()
|
int |
getHeight()
|
int |
getLocalZIndex()
Gets the Widget -local z-index. |
java.lang.String |
getName()
|
protected int |
getNumUsedRectangles()
|
int |
getOffsetXToRootMasterWidget()
Gets the x-offset relative to the master Widget. |
int |
getOffsetYToRootMasterWidget()
Gets the y-offset relative to the master Widget. |
static TransformableTexture |
getOrCreate(int width,
int height,
boolean pixelPerfectPositioning,
TransformableTexture possibleResult,
boolean tryToResize)
Gets a TransformableTexture with this image drawn onto it. |
Widget |
getOwnerWidget()
|
float |
getRotation()
|
float |
getRotationInDegrees()
|
int |
getRotCenterX()
Gets the center location for rotation. |
int |
getRotCenterY()
Gets the center location for rotation. |
float |
getScaleX()
|
float |
getScaleY()
|
TextureImage2D |
getTexture()
|
Texture2DCanvas |
getTextureCanvas()
|
byte[] |
getTextureData()
|
Rect2i |
getTransformedRectForEditor(java.awt.geom.AffineTransform at)
|
java.awt.geom.AffineTransform |
getTransformForEditor(int offsetX,
int offsetY)
|
float |
getTransX()
|
float |
getTransY()
|
int |
getWidth()
|
boolean |
isDynamic()
This flag must be set, if you intend to draw on this texture. |
protected boolean |
isRectangleVisible(int index)
|
boolean |
isVisible()
|
boolean |
isVisibleInEditor()
|
void |
setClipRect(int x,
int y,
int width,
int height,
boolean toggleVisibilityBySize)
|
void |
setDynamic(boolean dynamic)
This flag must be set, if you intend to draw on this texture. |
void |
setLocalZIndex(int zIndex)
Sets the Widget -local z-index. |
protected void |
setRectangleVisible(int index,
boolean visible)
|
void |
setRotation(float rotation)
|
void |
setRotationCenter(int rotCenterX,
int rotCenterY)
Sets the center location for rotation. |
void |
setRotationInDegrees(float rotDeg)
|
void |
setScale(float scaleX,
float scaleY)
|
void |
setTranslation(float transX,
float transY)
Set the sub texture's translation. |
void |
setVisible(boolean visible)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final boolean DEFAULT_PIXEL_PERFECT_POSITIONING
public static final float PI
public static final float TWO_PI
public static final float PI_HALF
public static final int MAX_NUM_TEXTURES
public static final int STRUCT_SIZE
Constructor Detail |
---|
public TransformableTexture(int width, int height, boolean pixelPerfectPositioning, float transX, float transY, int rotCenterX, int rotCenterY, float rotation, float scaleX, float scaleY, boolean usePowerOfTwoSizes)
public TransformableTexture(int width, int height, int transX, int transY, int rotCenterX, int rotCenterY, float rotation, float scaleX, float scaleY, boolean usePowerOfTwoSizes)
public TransformableTexture(int width, int height, boolean pixelPerfectPositioning, boolean usePowerOfTwoSizes)
public TransformableTexture(int width, int height)
Method Detail |
---|
public final java.lang.String getName()
public final Widget getOwnerWidget()
public final int getOffsetXToRootMasterWidget()
public final int getOffsetYToRootMasterWidget()
public static java.nio.ByteBuffer createByteBuffer()
public final TextureImage2D getTexture()
public final Texture2DCanvas getTextureCanvas()
protected void generateRectanglesForOneBigTexture(LiveGameData gameData, boolean isEditorMode, WidgetsConfiguration widgetsConfig)
protected final int getNumUsedRectangles()
protected void setRectangleVisible(int index, boolean visible)
protected final boolean isRectangleVisible(int index)
public void setDynamic(boolean dynamic)
dynamic
- dynamic?public final boolean isDynamic()
public void setLocalZIndex(int zIndex)
Widget
-local z-index. The only affects subtextures of a single Widget
or AbstractAssembledWidget
.
Higher values make the sub texture be drawn later then those with smaller values.
zIndex
- the new local z-indexpublic final int getLocalZIndex()
Widget
-local z-index. The only affects subtextures of a single Widget
or AbstractAssembledWidget
.
Higher values make the sub texture be drawn later then those with smaller values.
public void setVisible(boolean visible)
public final boolean isVisible()
public final boolean isVisibleInEditor()
public final int getWidth()
public final int getHeight()
public void setTranslation(float transX, float transY)
transX
- transY
- public final float getTransX()
public final float getTransY()
public void setRotationCenter(int rotCenterX, int rotCenterY)
rotCenterX
- rotCenterY
- public final int getRotCenterX()
public final int getRotCenterY()
public void setRotation(float rotation)
public final void setRotationInDegrees(float rotDeg)
public final float getRotation()
public final float getRotationInDegrees()
public void setScale(float scaleX, float scaleY)
public final float getScaleX()
public final float getScaleY()
public void setClipRect(int x, int y, int width, int height, boolean toggleVisibilityBySize)
public final Rect2i getClipRect(Rect2i r)
public final java.nio.ByteBuffer getDirtyRectsBuffer()
public final byte[] getTextureData()
protected int fillBuffer(boolean widgetVisibility, int offsetX, int offsetY, int index, int rectangleIndex, java.nio.ByteBuffer buffer)
public java.awt.geom.AffineTransform getTransformForEditor(int offsetX, int offsetY)
public Rect2i getTransformedRectForEditor(java.awt.geom.AffineTransform at)
public void drawInEditor(java.awt.Graphics2D texCanvas, java.awt.geom.AffineTransform at, Rect2i transformedRect)
public static TransformableTexture getOrCreate(int width, int height, boolean pixelPerfectPositioning, TransformableTexture possibleResult, boolean tryToResize)
TransformableTexture
with this image drawn onto it.
If the possibleResult is non null and has the correct size, it is returned.
width
- the desired widthheight
- the desired heightpixelPerfectPositioning
- prepare for pixel perfect positioningpossibleResult
- this instance is possibly retured, if it matches the parameterstryToResize
- if true, the passed in texture is resized to the given size, if the max size is sufficient.
This is useful in editor mode avoid constant recreations.
TransformableTexture
with this image drawn onto it.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |