Skip to main content

Texture

classe Texture

Class responsible for creating and storing a texture.


public class Texture

— Constructors (2) —

ConstructorDescription
Texture(int width, int height)Creates a new instance of Texture with its width and height defined to be arguments..
Texture(int width, int height, boolean allowModifications)Creates a new instance of the Texture with its width, height, and modification permission defined to be arguments.

— Methods (31) —

NameDescription
void apply()Applies all modifications made to Texture.
boolean isWritable()Returns true if Texture is writable, returns false if not.
int getWidth()Returns the current width of the Texture.
int getHeight()Returns the current height of the Texture.
Color getPixel(int x, int y)Returns the current Color of the Texture pixel definde to be coordinates.
Color getPixel(Vector2 coord)Returns the current Color of the Texture pixel defined be coordinates.
void setPixel(int x, int y, Color color)Sets the current Color of the Texture pixel defined to be coordinates.
void setPixel(Vector2 coord, Color color)Sets the current Color of the Texture pixel defined to be coordinates.
Color get(int x, int y)Returns the current Color of the Texture pixel defined to be coordinates.
Color get(int x, int y, Color out)Returns the current Color of the Texture pixel defined to be coordinates and applies the Color defined to be argument.
float getFloatRed(int x, int y)Returns the "red" Color of the Texture pixel defined to be coordinates.
float getFloatGreen(int x, int y)Returns the "green" Color of the Texture pixel defined to be coordinates.
float getFloatBlue(int x, int y)Returns the "blue" Color of the Texture pixel defined to be coordinates.
float getFloatAlpha(int x, int y)Returns the transparency (alpha) of the Texture pixel Color defined to be coodinates.
int getIntRed(int x, int y)Returns the "red" Color of the Texture pixel defined to be coordinates.
int getIntGreen(int x, int y)Returns the "green" Color of the Texture pixel defined to be coordinates.
int getIntBlue(int x, int y)Returns the "blue" Color of the Texture pixel defined to be coordinates.
int getIntAlpha(int x, int y)Returns the transparency (alpha) of the Texture pixel Color defined to be coodinates.
void set(int x, int y, Color color)Sets a Texture pixel with Color and position to be arguments.
void set(int x, int y, float colorRed, float colorGreen, float colorBlue, float colorAlpha)Sets a Texture pixel with Color, transparency (alpha) and position to be arguments.
void set(int x, int y, float colorRed, float colorGreen, float colorBlue)Sets a Texture pixel with Color and position to be arguments.
void setR(int x, int y, float value)Returns the "red" Color of the Texture pixel defined to be coordinates.
void setG(int x, int y, float value)Returns the "green" Color of the Texture pixel defined to be coordinates.
void setB(int x, int y, float value)Returns the "blue" Color of the Texture pixel defined to be coordinates.
void setA(int x, int y, float value)Sets the transparency (alpha) of the Texture pixel Color defined to be coodinates.
void set(int x, int y, int colorRed, int colorGreen, int colorBlue, int colorAlpha)Define um pixel da Textura com Cor, transparência (alpha) e posição definida nos argumentos.
void set(int x, int y, int colorRed, int colorGreen, int colorBlue)Define um pixel da Textura com Cor e posição definida nos argumentos.
void setR(int x, int y, int value)Sets the "red" Color of the Texture pixel defined to be coordinates.
void setG(int x, int y, int value)Sets the "green" Color of the Texture pixel defined to be coordinates.
void setB(int x, int y, int value)Sets the "blue" Color of the Texture pixel defined to be coordinates.
void setA(int x, int y, int value)Sets the transparency (alpha) of the Texture pixel Color defined to be coodinates.

— Static Methods (7) —

NameDescription
[Texture] loadFile([TextureFile] file)Loads a [TextureFile] in texture format defined to be argument.
[Texture] loadFile(File file)Loads a File in texture format defined to be argument.
[Texture] loadInputStream([InputStream] file)Loads a [InputStream] in texture format defined to be argument.
[Texture] newDepth(int width, int height)Creates a new OpenGL "Depth" Texture.
[Texture] white()Returns a texture in white.
[Texture] empty()Returns an empty texture.
boolean isRenderable([Texture] texture)Returns true if the Texture defined to be argument can be rendered, returns false if not.