|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Renderer
TWL Rendering interface
| Method Summary | |
|---|---|
void |
clipEnter(int x,
int y,
int w,
int h)
Enters a clip region. |
void |
clipEnter(Rect rect)
Enters a clip region. |
boolean |
clipIsEmpty()
Checks if the active clip region is empty (nothing will render). |
void |
clipLeave()
Leaves a clip region creeated by #clipEnter |
DynamicImage |
createDynamicImage(int width,
int height)
Creates a dynamic image with undefined content. |
Image |
createGradient(Gradient gradient)
|
CacheContext |
createNewCacheContext()
Creates a new cache context. |
void |
endRendering()
Clean up after rendering TWL. |
CacheContext |
getActiveCacheContext()
Returns the active cache context. |
FontMapper |
getFontMapper()
Returns the font mapper object if one is available. |
int |
getHeight()
Returns the height of the renderable surface |
LineRenderer |
getLineRenderer()
Returns the line renderer. |
OffscreenRenderer |
getOffscreenRenderer()
Returns the offscreen renderer. |
long |
getTimeMillis()
Returns the elapsed time in milliseconds. |
int |
getWidth()
Returns the width of the renderable surface |
Font |
loadFont(java.net.URL baseUrl,
StateSelect select,
FontParameter... parameterList)
Loads a font. |
Texture |
loadTexture(java.net.URL url,
java.lang.String format,
java.lang.String filter)
Loads a texture. |
void |
popGlobalTintColor()
|
void |
pushGlobalTintColor(float r,
float g,
float b,
float a)
Pushes a new tint color on the tint stack. |
void |
setActiveCacheContext(CacheContext cc)
Sets the active cache context. |
void |
setCursor(MouseCursor cursor)
|
void |
setMouseButton(int button,
boolean state)
Sets the mouse button state for SW mouse cursor rendering |
void |
setMousePosition(int mouseX,
int mouseY)
Sets the mouse position for SW mouse cursor rendering |
boolean |
startRendering()
Setup rendering for TWL. |
| Method Detail |
|---|
long getTimeMillis()
boolean startRendering()
Must be called before any Font or Image objects is drawn.
When this method returned true then endRendering()
must be called.
void endRendering()
startRendering() returned true
int getWidth()
int getHeight()
CacheContext createNewCacheContext()
setActiveCacheContext(de.matthiasmann.twl.renderer.CacheContext)
void setActiveCacheContext(CacheContext cc)
throws java.lang.IllegalStateException
cc - The CacheContext object
java.lang.NullPointerException - when cc is null
java.lang.IllegalStateException - when the CacheContext object is invalidCacheContext getActiveCacheContext()
Font loadFont(java.net.URL baseUrl,
StateSelect select,
FontParameter... parameterList)
throws java.io.IOException
baseUrl - the base URL that can be used to load font dataselect - the StateSelect objectparameterList - the font parameters - must be exactly 1 more then
the number of expressions in the select object
java.io.IOException - if the font could not be loaded
java.lang.NullPointerException - when one of the parameters is null
java.lang.IllegalArgumentException - when the number of font parameters doesn't match the number of state expressions
Texture loadTexture(java.net.URL url,
java.lang.String format,
java.lang.String filter)
throws java.io.IOException
url - the URL of the texture fileformat - a format description - depends on the implementationfilter - how the texture should be filtered - should support "nearest" and linear"
java.io.IOException - if the texture could not be loadedLineRenderer getLineRenderer()
OffscreenRenderer getOffscreenRenderer()
FontMapper getFontMapper()
DynamicImage createDynamicImage(int width,
int height)
width - the width of the imageheight - the height of the image
Image createGradient(Gradient gradient)
void clipEnter(int x,
int y,
int w,
int h)
x - the left edgey - the top edgew - the widthh - the heightvoid clipEnter(Rect rect)
rect - the coordinatesboolean clipIsEmpty()
void clipLeave()
#clipEnter
clipEnter(int, int, int, int),
clipEnter(de.matthiasmann.twl.Rect)void setCursor(MouseCursor cursor)
void setMousePosition(int mouseX,
int mouseY)
mouseX - X mouse positionmouseY - Y mouse position
void setMouseButton(int button,
boolean state)
button - the mouse buttonstate - true if the mouse button is pressedEvent.MOUSE_LBUTTON,
Event.MOUSE_MBUTTON,
Event.MOUSE_RBUTTON
void pushGlobalTintColor(float r,
float g,
float b,
float a)
pushGlobalTintColor a call to popGlobalTintColor
must be made.
r - red, must be 0.0f <= r <= 1.0fg - green, must be 0.0f <= g <= 1.0fb - blue, must be 0.0f <= b <= 1.0fa - alpha, must be 0.0f <= a <= 1.0fvoid popGlobalTintColor()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||