|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ITexture
Method Summary | |
---|---|
void |
bind()
bind the current texture in the VRAM |
void |
bind(int unit)
bind the current texture object in the specified texture unit |
WrappedBuffer |
getData()
returns the texture's pixel in a ByteBuffer EXAMPLE: ByteBuffer bb = getData(); byte r, g, b; bb.rewind(); //<-- IMPORTANT!! try { while (true) { bb.mark(); r = bb.get(); g = bb.get(); b = bb.get(); bb.reset(); bb.put((byte)(r+red)); bb.put((byte)(g+green)); bb.put((byte)(b+blue)); bb.get(); // alpha } } catch (Exception e) { } setData(bb); |
int |
getHeight()
returns the height of image |
int |
getHeightHW()
return the height hardware of image |
int |
getID()
returns the ID of image in the Vram |
int |
getWidth()
returns the width of image |
int |
getWidthHW()
return the width Hardware of image |
float |
getXEnd()
returns the end X-coordinate |
float |
getXStart()
returns the start X-coordinate |
float |
getYEnd()
returns the end Y-coordinate |
float |
getYStart()
returns the start Y-coordinate |
boolean |
isSolid()
indicates if the texture is solid or not. a non solid texture is a texture that containe an alpha channel |
void |
makeTransp(int red,
int green,
int blue)
sets transparent each pixel that it's equal to the red, green blue value specified |
void |
setAlphaForeach(int red,
int green,
int blue,
int alpha)
sets the specified alpha for each pixel that it's equal to the red, green blue value specified |
void |
setData(java.nio.ByteBuffer data)
sets the texture's pixel from a ByteBuffer EXAMPLE: ByteBuffer bb = getData(); byte r, g, b; bb.rewind(); //<-- IMPORTANT!! try { while (true) { bb.mark(); r = bb.get(); g = bb.get(); b = bb.get(); bb.reset(); bb.put((byte)(r+red)); bb.put((byte)(g+green)); bb.put((byte)(b+blue)); bb.get(); // alpha } } catch (Exception e) { } setData(bb); |
void |
setMask(Mask mask)
Pixel collision mask of texture |
void |
setRegion(int x,
int y,
int width,
int height)
sets the region of the image |
Methods inherited from interface zombie.interfaces.IDestroyable |
---|
destroy, isDestroyed |
Methods inherited from interface zombie.interfaces.IMaskerable |
---|
getMask |
Method Detail |
---|
void bind()
void bind(int unit)
unit
- the texture unit in witch the current TextureObject will be bindedWrappedBuffer getData()
int getHeight()
int getHeightHW()
int getID()
int getWidth()
int getWidthHW()
float getXEnd()
float getXStart()
float getYEnd()
float getYStart()
boolean isSolid()
void makeTransp(int red, int green, int blue)
red
- color used in the testgreen
- color used in the testblue
- color used in the testvoid setAlphaForeach(int red, int green, int blue, int alpha)
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 testvoid setData(java.nio.ByteBuffer data)
data
- texture's pixel datavoid setMask(Mask mask)
mask
- void setRegion(int x, int y, int width, int height)
x
- xstart positiony
- ystart positionwidth
- width of the regionheight
- height of the region
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |