de.matthiasmann.twl.renderer
Interface Texture

All Superinterfaces:
Resource
All Known Implementing Classes:
LWJGLTexture

public interface Texture
extends Resource

A texture class. Can not be used for rendering directly.


Nested Class Summary
static class Texture.Rotation
           
 
Method Summary
 MouseCursor createCursor(int x, int y, int width, int height, int hotSpotX, int hotSpotY, Image imageRef)
           
 int getHeight()
          Returns the height in pixels of this texture.
 Image getImage(int x, int y, int width, int height, Color tintColor, boolean tiled, Texture.Rotation rotation)
          Creates an image from a sub section of this texture.
 int getWidth()
          Returns the width in pixels of this texture.
 void themeLoadingDone()
          After calling this function getImage() and createCursor() may fail to work
 
Methods inherited from interface de.matthiasmann.twl.renderer.Resource
destroy
 

Method Detail

getWidth

int getWidth()
Returns the width in pixels of this texture.

Returns:
the width in pixels of this texture.

getHeight

int getHeight()
Returns the height in pixels of this texture.

Returns:
the height in pixels of this texture.

getImage

Image getImage(int x,
               int y,
               int width,
               int height,
               Color tintColor,
               boolean tiled,
               Texture.Rotation rotation)
Creates an image from a sub section of this texture.

Parameters:
x - left coordinate in the texture of the image
y - top coordinate in the texture of the image
width - width in pixels of the image - if negative the image is horizontaly flipped
height - height in pixels of the image - if negative the image is vertically flipped
tintColor - the tintColor - maybe null
tiled - true if this image should do tiled rendering
rotation - the rotation to apply to this sub section while rendering
Returns:
an image object
See Also:
Image.createTintedVersion(de.matthiasmann.twl.Color)

createCursor

MouseCursor createCursor(int x,
                         int y,
                         int width,
                         int height,
                         int hotSpotX,
                         int hotSpotY,
                         Image imageRef)

themeLoadingDone

void themeLoadingDone()
After calling this function getImage() and createCursor() may fail to work