de.lessvoid.nifty.render
Interface NiftyRenderEngine

All Known Implementing Classes:
NiftyRenderDeviceProxy, NiftyRenderEngineImpl

public interface NiftyRenderEngine

NiftyRenderEngine interface.

Author:
void

Method Summary
 void beginFrame()
          Called when a frame begins.
 void clear()
          Clear the screen.
 RenderFont createFont(String name)
          Create a new RenderFont.
 NiftyImage createImage(String name, boolean filterLinear)
          Create a new Image.
 void disableClip()
          Disable the clipping.
 void displayResolutionChanged()
          This is called from Nifty when it receives the resolutionChange notify from application code.
 void disposeImage(RenderImage image)
          Dispose image.
 void enableClip(int x0, int y0, int x1, int y1)
          Enable clipping to the given region.
 void endFrame()
          Called when a frame ends.
 RenderFont getFont()
          get font.
 String getFontname(RenderFont font)
          Returns the original filename of the given RenderFont.
 int getHeight()
          Get Height of Display mode.
 RenderDevice getRenderDevice()
          Get RenderDevice.
 int getWidth()
          Get Width of Display mode.
 boolean isColorAlphaChanged()
          return true when color alpha has been changed.
 boolean isColorChanged()
          return true when color has been changed.
 void moveTo(float xParam, float yParam)
          Move to the given x/y position.
 RenderImage reload(RenderImage image)
          Dispose the given image and reload it.
 void renderImage(NiftyImage image, int x, int y, int width, int height)
          Render Image.
 void renderQuad(int x, int y, int width, int height)
          render a quad.
 void renderQuad(int x, int y, int width, int height, Color topLeft, Color topRight, Color bottomRight, Color bottomLeft)
          Renders a quad with different colors at the quad vertices.
 void renderText(String text, int x, int y, int selectionStart, int selectionEnd, Color textSelectionColor)
          renderText.
 void restoreState()
          restore states.
 void saveState(RenderStates statesToSave)
          save given states.
 void setBlendMode(BlendMode blendMode)
          Set BlendMode.
 void setColor(Color colorParam)
          Set a new color.
 void setColorAlpha(float newColorAlpha)
          set only the color alpha.
 void setColorIgnoreAlpha(Color color)
          Set only the color component of the given color.
 void setFont(RenderFont font)
          set font.
 void setGlobalPosition(float xPos, float yPos)
          set global position.
 void setImageScale(float scale)
          set image size.
 void setRenderTextSize(float size)
          Set RenderTextSize.
 

Method Detail

getWidth

int getWidth()
Get Width of Display mode.

Returns:
width of display mode

getHeight

int getHeight()
Get Height of Display mode.

Returns:
height of display mode

beginFrame

void beginFrame()
Called when a frame begins.


endFrame

void endFrame()
Called when a frame ends.


clear

void clear()
Clear the screen.


createImage

NiftyImage createImage(String name,
                       boolean filterLinear)
Create a new Image.

Parameters:
name - file name to use
filterLinear - filter
Returns:
RenderImage instance

createFont

RenderFont createFont(String name)
Create a new RenderFont.

Parameters:
name - name of the font
Returns:
RenderFont instance

getFontname

String getFontname(RenderFont font)
Returns the original filename of the given RenderFont.

Parameters:
font - RenderFont to get the name from
Returns:
the filename of the font

renderQuad

void renderQuad(int x,
                int y,
                int width,
                int height)
render a quad.

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

renderQuad

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

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

renderImage

void renderImage(NiftyImage image,
                 int x,
                 int y,
                 int width,
                 int height)
Render Image.

Parameters:
image - the image to render
x - the x position on the screen
y - the y position on the screen
width - the width
height - the height

renderText

void renderText(String text,
                int x,
                int y,
                int selectionStart,
                int selectionEnd,
                Color textSelectionColor)
renderText.

Parameters:
text - text
x - x
y - y
selectionStart - selection start
selectionEnd - selection end
textSelectionColor - color for text selections

setFont

void setFont(RenderFont font)
set font.

Parameters:
font - font

getFont

RenderFont getFont()
get font.

Returns:
font

setColor

void setColor(Color colorParam)
Set a new color.

Parameters:
colorParam - new current color to set

setColorAlpha

void setColorAlpha(float newColorAlpha)
set only the color alpha.

Parameters:
newColorAlpha - new alpha value

setColorIgnoreAlpha

void setColorIgnoreAlpha(Color color)
Set only the color component of the given color. This assumes that alpha has already been changed.

Parameters:
color - color

isColorChanged

boolean isColorChanged()
return true when color has been changed.

Returns:
color changed

isColorAlphaChanged

boolean isColorAlphaChanged()
return true when color alpha has been changed.

Returns:
color changed

setBlendMode

void setBlendMode(BlendMode blendMode)
Set BlendMode.


moveTo

void moveTo(float xParam,
            float yParam)
Move to the given x/y position.

Parameters:
xParam - x
yParam - y

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 the clipping.


setRenderTextSize

void setRenderTextSize(float size)
Set RenderTextSize.

Parameters:
size - size

setImageScale

void setImageScale(float scale)
set image size.

Parameters:
scale - new image size

setGlobalPosition

void setGlobalPosition(float xPos,
                       float yPos)
set global position.

Parameters:
xPos - x
yPos - y

saveState

void saveState(RenderStates statesToSave)
save given states.

Parameters:
statesToSave - set of renderstates to save

restoreState

void restoreState()
restore states.


getRenderDevice

RenderDevice getRenderDevice()
Get RenderDevice.

Returns:

disposeImage

void disposeImage(RenderImage image)
Dispose image.

Parameters:
image - image to dispose

reload

RenderImage reload(RenderImage image)
Dispose the given image and reload it.

Parameters:
image - image
Returns:
the reloaded image

displayResolutionChanged

void displayResolutionChanged()
This is called from Nifty when it receives the resolutionChange notify from application code. The RenderEngine will update the cached values of width/height from the RenderDevice it has stored inside.



Copyright © 2011. All Rights Reserved.