Class Texture
java.lang.Object
zombie.asset.Asset
zombie.core.textures.Texture
- All Implemented Interfaces:
Serializable
,IDestroyable
,IMaskerable
,ITexture
- Direct Known Subclasses:
AngelCodeFont.CharDefTexture
,SmartTexture
,VideoTexture
- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class zombie.asset.Asset
Asset.ObserverCallback, Asset.State
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final AssetType
static boolean
boolean
static int
indicates if all the texture will auto create the masks on load The auto creation works only with the getTexture() methodsprotected TextureID
boolean
protected int
protected int
static float
static int
static int
static float
static float
static float
protected Mask
protected String
float
float
protected boolean
protected FileSystem.SubTexture
static int
static boolean
protected int
protected int
float
internal texture coordinates it's used to get the max border of texture...float
internal texture coordinates it's used to get the max border of texture...float
internal texture coordinates it's used to get the max border of texture...float
internal texture coordinates it's used to get the max border of texture...Fields inherited from class zombie.asset.Asset
isDefered, m_asset_manager
-
Constructor Summary
ConstructorsConstructorDescriptionTexture()
creates an emptiy texture and adds it to the game engine's texture listTexture
(int _width, int _height, int flags) create a new empty texture.Texture
(int int1, int int3, int var3, boolean var4) Texture
(int int0, int int1, int int2, int int3, int int4) create a new empty texture.LOADS and crete a texture from a fileLOADS and crete a texture from a fileloads and create a texture from a file and cretes as trasparent the section that have the color equal to the RGB valued spefiedTexture
(String _name, BufferedInputStream b, boolean bDoMask) Texture
(AssetPath path, AssetManager manager, Texture.TextureAssetParams params) creates a copy of an existent texture -
Method Summary
Modifier and TypeMethodDescriptionvoid
bind()
Blinds the imagevoid
bind
(int unit) Description copied from interface: ITexturestatic void
bindNone()
static void
static void
void
copyMaskRegion
(Texture from, int x, int y, int _width, int _height) void
creates the mask of collisionsvoid
createMask
(boolean[] boolean0) void
createMask
(BooleanGrid _mask) void
createMask
(WrappedBuffer buf) void
destroy()
destroys the image and release all resourcesboolean
static int[]
flipPixels
(int[] int1, int int2, int int3) static void
forgetTexture
(String _name) getData()
returns the texture's pixel in a ByteBufferstatic Texture
static Texture
int
Description copied from interface: ITextureint
Description copied from interface: ITextureint
int
getID()
Description copied from interface: ITexturegetMask()
returns the mask of collisionsgetName()
float
float
int
int
static Texture
getSharedTexture
(String _name) static Texture
getSharedTexture
(String _name, int flags) static Texture
getSteamAvatar
(long steamID) static Texture
getTexture
(String _name) gets a texture from it's name; If the texture isn't already loaded this method will load it.getType()
boolean
indicates if the image will use the alpha channel or notegetUVScale
(Vector2 uvScale) static Texture
getWhite()
int
getWidth()
Description copied from interface: ITextureint
Description copied from interface: ITextureint
int
getX()
float
getXEnd()
Description copied from interface: ITexturefloat
Description copied from interface: ITextureint
getY()
float
getYEnd()
Description copied from interface: ITexturefloat
Description copied from interface: ITextureboolean
indicates if the texture has a mask of collisions or notboolean
returns if the texture is destroyed or notboolean
isMaskSet
(int int1, int int0) boolean
isSolid()
Description copied from interface: ITextureboolean
isValid()
void
loadMaskRegion
(ByteBuffer cache) void
makeTransp
(int red, int green, int blue) Description copied from interface: ITexturevoid
static void
static String
processFilePath
(String filePath) static void
void
reloadFromFile
(String _name) void
render
(float x, float y) void
render
(float x, float y, float _width, float _height) void
render
(float x, float y, float _width, float _height, float r, float g, float b, float a, Consumer<TextureDraw> texdModifier) void
render
(ObjectRenderEffects dr, float x, float y, float _width, float _height, float r, float g, float b, float a, Consumer<TextureDraw> texdModifier) void
renderdiamond
(float x, float y, float _width, float _height, int l, int u, int r, int d) void
rendershader2
(float x, float y, float _width, float _height, int texx, int texy, int texWidth, int texHeight, float r, float g, float b, float a) void
renderstrip
(int x, int y, int _width, int _height, float r, float g, float b, float a, Consumer<TextureDraw> texdModifier) void
renderwalln
(float x, float y, float _width, float _height, int u, int d, int u2, int d2) void
renderwallnw
(float x, float y, float _width, float _height, int u, int d, int u2, int d2, int r, int r2) void
renderwallw
(float x, float y, float _width, float _height, int u, int d, int u2, int d2) void
void
saveMaskRegion
(ByteBuffer cache) void
saveOnRenderThread
(String filename) void
saveToCurrentSavefileDirectory
(String filename) void
saveToZomboidDirectory
(String filename) void
setAlphaForeach
(int red, int green, int blue, int alpha) Description copied from interface: ITexturevoid
void
setData
(ByteBuffer data) sets the texture's pixel from a ByteBuffervoid
setHeight
(int _height) void
sets the mask of collisionsvoid
void
setNameOnly
(String _name) void
setOffsetX
(int offset) void
setOffsetY
(int offset) void
setRealHeight
(int _realHeight) void
setRealWidth
(int _realWidth) void
setRegion
(int x, int y, int _width, int _height) Description copied from interface: ITexturevoid
setUseAlphaChannel
(boolean value) indicates if the texture contains the alpha channel or notvoid
setWidth
(int _width) split
(int xOffset, int yOffset, int _width, int _height) Texture[]
split
(int xOffset, int yOffset, int row, int coloumn, int _width, int _height, int spaceX, int spaceY) Texture[][]
split2D
(int[] int1, int[] int0) static void
steamAvatarChanged
(long steamID) void
TexDeferedCreation
(int int0, int int1, int int2) void
TexDeferedCreation
(int int1, int int0, int int2, int int3, int int4) toString()
static Texture
trygetTexture
(String _name) Methods inherited from class zombie.asset.Asset
addDependency, getAssetManager, getObserverCb, getPath, getRefCount, getState, isEmpty, isFailure, isReady, onBeforeEmpty, onCreated, removeDependency, setAssetParams
-
Field Details
-
nullTextures
-
BindCount
public static int BindCountindicates if all the texture will auto create the masks on load The auto creation works only with the getTexture() methods -
bDoingQuad
public static boolean bDoingQuad -
lr
public static float lr -
lg
public static float lg -
lb
public static float lb -
la
public static float la -
lastlastTextureID
public static int lastlastTextureID -
totalTextureID
public static int totalTextureID -
lastTextureID
public static int lastTextureID -
WarnFailFindTexture
public static boolean WarnFailFindTexture -
flip
public boolean flip -
offsetX
public float offsetX -
offsetY
public float offsetY -
bindAlways
public boolean bindAlways -
xEnd
public float xEndinternal texture coordinates it's used to get the max border of texture... -
yEnd
public float yEndinternal texture coordinates it's used to get the max border of texture... -
xStart
public float xStartinternal texture coordinates it's used to get the max border of texture... -
yStart
public float yStartinternal texture coordinates it's used to get the max border of texture... -
dataid
-
mask
-
name
-
solid
protected boolean solid -
width
protected int width -
height
protected int height -
heightOrig
protected int heightOrig -
widthOrig
protected int widthOrig -
subTexture
-
assetParams
-
ASSET_TYPE
-
-
Constructor Details
-
Texture
-
Texture
-
Texture
-
Texture
-
Texture
- Throws:
Exception
-
Texture
-
Texture
-
Texture
create a new empty texture.- Parameters:
_width
- size of texture_height
- size of texture_name
-flags
-
-
Texture
public Texture(int _width, int _height, int flags) create a new empty texture.- Parameters:
_width
- size of texture_height
- size of textureflags
-
-
Texture
public Texture(int int0, int int1, int int2, int int3, int int4) -
Texture
public Texture(int int1, int int3, int var3, boolean var4) -
Texture
loads and create a texture from a file and cretes as trasparent the section that have the color equal to the RGB valued spefied- Parameters:
file
- relative pathred
- red value to comparegreen
- green value to compareblue
- blue value to compare- Throws:
Exception
-
Texture
-
Texture
public Texture()creates an emptiy texture and adds it to the game engine's texture list
-
-
Method Details
-
TexDeferedCreation
public void TexDeferedCreation(int int1, int int0, int int2, int int3, int int4) -
TexDeferedCreation
public void TexDeferedCreation(int int0, int int1, int int2) -
processFilePath
-
bindNone
public static void bindNone() -
getWhite
-
getErrorTexture
-
getEngineMipmapTexture
-
clearTextures
public static void clearTextures() -
trygetTexture
-
onTexturePacksChanged
public static void onTexturePacksChanged() -
getTexture
-
getSteamAvatar
-
steamAvatarChanged
public static void steamAvatarChanged(long steamID) -
forgetTexture
-
reload
-
flipPixels
public static int[] flipPixels(int[] int1, int int2, int int3) -
reloadFromFile
-
bind
-
bind
-
copyMaskRegion
-
createMask
public void createMask()creates the mask of collisions -
createMask
public void createMask(boolean[] boolean0) -
createMask
-
createMask
-
destroy
public void destroy()destroys the image and release all resources- Specified by:
destroy
in interfaceIDestroyable
-
equals
-
getData
returns the texture's pixel in a ByteBuffer -
setData
sets the texture's pixel from a ByteBuffer -
getHeight
-
setHeight
public void setHeight(int _height) -
getHeightHW
public int getHeightHW()Description copied from interface: ITexture- Specified by:
getHeightHW
in interfaceITexture
-
getHeightOrig
public int getHeightOrig() -
getID
-
getMask
returns the mask of collisions- Specified by:
getMask
in interfaceIMaskerable
- Returns:
- mask of collisions
-
setMask
-
isMaskSet
public boolean isMaskSet(int int1, int int0) -
getName
-
setName
-
getTextureId
-
getUseAlphaChannel
public boolean getUseAlphaChannel()indicates if the image will use the alpha channel or note- Returns:
- if the image will use the alpha channel or note
-
setUseAlphaChannel
public void setUseAlphaChannel(boolean value) indicates if the texture contains the alpha channel or not- Parameters:
value
- if true, the image will use the alpha channel
-
getX
public int getX() -
getY
public int getY() -
getWidth
-
setWidth
public void setWidth(int _width) -
getWidthHW
public int getWidthHW()Description copied from interface: ITexture- Specified by:
getWidthHW
in interfaceITexture
-
getWidthOrig
public int getWidthOrig() -
getXEnd
-
getXStart
-
getYEnd
-
getYStart
-
getOffsetX
public float getOffsetX() -
setOffsetX
public void setOffsetX(int offset) -
getOffsetY
public float getOffsetY() -
setOffsetY
public void setOffsetY(int offset) -
isCollisionable
public boolean isCollisionable()indicates if the texture has a mask of collisions or not -
isDestroyed
public boolean isDestroyed()returns if the texture is destroyed or not- Specified by:
isDestroyed
in interfaceIDestroyable
-
isSolid
-
isValid
public boolean isValid() -
makeTransp
public void makeTransp(int red, int green, int blue) Description copied from interface: ITexture- Specified by:
makeTransp
in interfaceITexture
- Parameters:
red
- color used in the testgreen
- color used in the testblue
- color used in the test
-
render
public void render(float x, float y, float _width, float _height) -
render
public void render(float x, float y) -
render
public void render(float x, float y, float _width, float _height, float r, float g, float b, float a, Consumer<TextureDraw> texdModifier) -
render
public void render(ObjectRenderEffects dr, float x, float y, float _width, float _height, float r, float g, float b, float a, Consumer<TextureDraw> texdModifier) -
rendershader2
public void rendershader2(float x, float y, float _width, float _height, int texx, int texy, int texWidth, int texHeight, float r, float g, float b, float a) -
renderdiamond
public void renderdiamond(float x, float y, float _width, float _height, int l, int u, int r, int d) -
renderwallnw
public void renderwallnw(float x, float y, float _width, float _height, int u, int d, int u2, int d2, int r, int r2) -
renderwallw
public void renderwallw(float x, float y, float _width, float _height, int u, int d, int u2, int d2) -
renderwalln
public void renderwalln(float x, float y, float _width, float _height, int u, int d, int u2, int d2) -
renderstrip
public void renderstrip(int x, int y, int _width, int _height, float r, float g, float b, float a, Consumer<TextureDraw> texdModifier) -
setAlphaForeach
public void setAlphaForeach(int red, int green, int blue, int alpha) Description copied from interface: ITexture- Specified by:
setAlphaForeach
in interfaceITexture
- Parameters:
red
- color used in the testgreen
- color used in the testblue
- color used in the testalpha
- the alpha color that will be setted to the pixel that pass the test
-
setCustomizedTexture
public void setCustomizedTexture() -
setNameOnly
-
setRegion
-
splitIcon
-
split
-
split
-
split
public Texture[] split(int xOffset, int yOffset, int row, int coloumn, int _width, int _height, int spaceX, int spaceY) -
split2D
-
toString
-
saveMask
-
saveToZomboidDirectory
-
saveToCurrentSavefileDirectory
-
saveOnRenderThread
-
loadMaskRegion
-
saveMaskRegion
-
getRealWidth
public int getRealWidth() -
setRealWidth
public void setRealWidth(int _realWidth) -
getRealHeight
public int getRealHeight() -
setRealHeight
public void setRealHeight(int _realHeight) -
getUVScale
-
getType
-
onBeforeReady
public void onBeforeReady()- Overrides:
onBeforeReady
in classAsset
-
collectAllIcons
-