de.lessvoid.nifty.spi.render
Interface RenderDevice

All Known Implementing Classes:
NullRenderDevice, ScalingRenderDevice

public interface RenderDevice

Nifty RenderDevice.

Author:
void

Method Summary
 void beginFrame()
          Called every begin frame.
 void clear()
          clear screen.
 RenderFont createFont(String filename)
          Create a new RenderFont.
 RenderImage createImage(String filename, boolean filterLinear)
          Create a new RenderImage.
 MouseCursor createMouseCursor(String filename, int hotspotX, int hotspotY)
          Create a new mouse cursor.
 void disableClip()
          Disable Clipping.
 void disableMouseCursor()
          Disable the current mouse cursor.
 void enableClip(int x0, int y0, int x1, int y1)
          Enable clipping to the given region.
 void enableMouseCursor(MouseCursor mouseCursor)
          Enable the given mouse cursor.
 void endFrame()
          Called every end frame.
 int getHeight()
          Get Height.
 int getWidth()
          Get Width.
 void renderFont(RenderFont font, String text, int x, int y, Color fontColor, float sizeX, float sizeY)
          Render the given text at the given position.
 void renderImage(RenderImage image, int x, int y, int width, int height, Color color, float imageScale)
          Render the image.
 void renderImage(RenderImage image, int x, int y, int w, int h, int srcX, int srcY, int srcW, int srcH, Color color, float scale, int centerX, int centerY)
          Render a sub image of this image.
 void renderQuad(int x, int y, int width, int height, Color color)
          Render a quad.
 void renderQuad(int x, int y, int width, int height, Color topLeft, Color topRight, Color bottomRight, Color bottomLeft)
          Render a quad with different colors at the vertices.
 void setBlendMode(BlendMode renderMode)
          Change the RenderMode to the given Mode.
 void setResourceLoader(NiftyResourceLoader niftyResourceLoader)
          Gives this RenderDevice access to the NiftyResourceLoader.
 

Method Detail

setResourceLoader

void setResourceLoader(NiftyResourceLoader niftyResourceLoader)
Gives this RenderDevice access to the NiftyResourceLoader.

Parameters:
niftyResourceLoader - NiftyResourceLoader

createImage

RenderImage createImage(String filename,
                        boolean filterLinear)
Create a new RenderImage.

Parameters:
filename - filename
filterLinear - filter
Returns:
RenderImage

createFont

RenderFont createFont(String filename)
Create a new RenderFont.

Parameters:
filename - filename
Returns:
RenderFont

getWidth

int getWidth()
Get Width.

Returns:
width of display mode

getHeight

int getHeight()
Get Height.

Returns:
height of display mode

beginFrame

void beginFrame()
Called every begin frame.


endFrame

void endFrame()
Called every end frame.


clear

void clear()
clear screen.


setBlendMode

void setBlendMode(BlendMode renderMode)
Change the RenderMode to the given Mode.

Parameters:
renderMode - RenderMode

renderQuad

void renderQuad(int x,
                int y,
                int width,
                int height,
                Color color)
Render a quad.

Parameters:
x - x
y - y
width - width
height - height
color - color

renderQuad

void renderQuad(int x,
                int y,
                int width,
                int height,
                Color topLeft,
                Color topRight,
                Color bottomRight,
                Color bottomLeft)
Render a quad with different colors at the vertices.

Parameters:
x -
y -
width -
height -
topLeft -
topRight -
bottomRight -
bottomLeft -

renderImage

void renderImage(RenderImage image,
                 int x,
                 int y,
                 int width,
                 int height,
                 Color color,
                 float imageScale)
Render the image.

Parameters:
x - x
y - y
width - w
height - h
color - color
imageScale - image scale

renderImage

void renderImage(RenderImage image,
                 int x,
                 int y,
                 int w,
                 int h,
                 int srcX,
                 int srcY,
                 int srcW,
                 int srcH,
                 Color color,
                 float scale,
                 int centerX,
                 int centerY)
Render a sub image of this image.

Parameters:
x - x
y - y
w - w
h - h
srcX - source x
srcY - source y
srcW - source width
srcH - source height
color - color

renderFont

void renderFont(RenderFont font,
                String text,
                int x,
                int y,
                Color fontColor,
                float sizeX,
                float sizeY)
Render the given text at the given position.

Parameters:
text - text to render
x - x position
y - y position
fontColor - font color
size - size

enableClip

void enableClip(int x0,
                int y0,
                int x1,
                int y1)
Enable clipping to the given region.

Parameters:
x0 - x0
y0 - y0
x1 - x1
y1 - y1

disableClip

void disableClip()
Disable Clipping.


createMouseCursor

MouseCursor createMouseCursor(String filename,
                              int hotspotX,
                              int hotspotY)
                              throws IOException
Create a new mouse cursor.

Parameters:
filename - image file for the cursor
hotspotX - hotspot x with 0 being left of the screen
hotspotY - hotspot y with 0 being top of the screen
Returns:
the loaded mouse cursor resource ready to be applied
Throws:
IOException

enableMouseCursor

void enableMouseCursor(MouseCursor mouseCursor)
Enable the given mouse cursor.

Parameters:
mouseCursor - the mouse cursor to enable

disableMouseCursor

void disableMouseCursor()
Disable the current mouse cursor.



Copyright © 2011. All Rights Reserved.