de.lessvoid.nifty.effects
Class NiftyRenderDeviceProxy

java.lang.Object
  extended by de.lessvoid.nifty.effects.NiftyRenderDeviceProxy
All Implemented Interfaces:
NiftyRenderEngine

public class NiftyRenderDeviceProxy
extends Object
implements NiftyRenderEngine

RenderDeviceProxy.

Author:
void

Constructor Summary
NiftyRenderDeviceProxy()
           
 
Method Summary
 void beginFrame()
          Called when a frame begins.
 void clear()
          Clear the screen.
 int convertFromNativeX(int x)
           
 int convertFromNativeY(int y)
           
 int convertToNativeHeight(int y)
           
 float convertToNativeTextSizeX(float size)
           
 float convertToNativeTextSizeY(float size)
           
 int convertToNativeWidth(int x)
           
 int convertToNativeX(int x)
           
 int convertToNativeY(int y)
           
 RenderFont createFont(String name)
          Create a new RenderFont.
 NiftyImage createImage(String name, boolean filterLinear)
          Create a new Image.
 void disableAutoScaling()
           
 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 enableAutoScaling(int baseResolutionX, int baseResolutionY)
           
 void enableAutoScaling(int baseResolutionX, int baseResolutionY, float scaleX, float scaleY)
           
 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.
 int getNativeHeight()
          This will always return the current native display resolution independent of the auto scaling mode.
 int getNativeWidth()
          This will always return the current native display resolution independent of the auto scaling mode.
 RenderDevice getRenderDevice()
          Get RenderDevice.
 RenderStates getStates()
           
 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 param, float param2)
          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 c)
          renderText.
 void reset()
           
 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 pos, float pos2)
          set global position.
 void setImageScale(float scale)
          set image size.
 void setRenderTextSize(float size)
          Set RenderTextSize.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NiftyRenderDeviceProxy

public NiftyRenderDeviceProxy()
Method Detail

beginFrame

public void beginFrame()
Description copied from interface: NiftyRenderEngine
Called when a frame begins.

Specified by:
beginFrame in interface NiftyRenderEngine

endFrame

public void endFrame()
Description copied from interface: NiftyRenderEngine
Called when a frame ends.

Specified by:
endFrame in interface NiftyRenderEngine

clear

public void clear()
Description copied from interface: NiftyRenderEngine
Clear the screen.

Specified by:
clear in interface NiftyRenderEngine

createFont

public RenderFont createFont(String name)
Description copied from interface: NiftyRenderEngine
Create a new RenderFont.

Specified by:
createFont in interface NiftyRenderEngine
Parameters:
name - name of the font
Returns:
RenderFont instance

getFontname

public String getFontname(RenderFont font)
Description copied from interface: NiftyRenderEngine
Returns the original filename of the given RenderFont.

Specified by:
getFontname in interface NiftyRenderEngine
Parameters:
font - RenderFont to get the name from
Returns:
the filename of the font

createImage

public NiftyImage createImage(String name,
                              boolean filterLinear)
Description copied from interface: NiftyRenderEngine
Create a new Image.

Specified by:
createImage in interface NiftyRenderEngine
Parameters:
name - file name to use
filterLinear - filter
Returns:
RenderImage instance

disableClip

public void disableClip()
Description copied from interface: NiftyRenderEngine
Disable the clipping.

Specified by:
disableClip in interface NiftyRenderEngine

enableClip

public void enableClip(int x0,
                       int y0,
                       int x1,
                       int y1)
Description copied from interface: NiftyRenderEngine
Enable clipping to the given region.

Specified by:
enableClip in interface NiftyRenderEngine
Parameters:
x0 - x0
y0 - y0
x1 - x1
y1 - y1

getHeight

public int getHeight()
Description copied from interface: NiftyRenderEngine
Get Height of Display mode. This will always return the base resolution if auto scaling is enabled.

Specified by:
getHeight in interface NiftyRenderEngine
Returns:
height of display mode

getWidth

public int getWidth()
Description copied from interface: NiftyRenderEngine
Get Width of Display mode. This will always return the base resolution if auto scaling is enabled.

Specified by:
getWidth in interface NiftyRenderEngine
Returns:
width of display mode

getNativeWidth

public int getNativeWidth()
Description copied from interface: NiftyRenderEngine
This will always return the current native display resolution independent of the auto scaling mode.

Specified by:
getNativeWidth in interface NiftyRenderEngine
Returns:
the native display width

getNativeHeight

public int getNativeHeight()
Description copied from interface: NiftyRenderEngine
This will always return the current native display resolution independent of the auto scaling mode.

Specified by:
getNativeHeight in interface NiftyRenderEngine
Returns:
the native display height

setColor

public void setColor(Color colorParam)
Description copied from interface: NiftyRenderEngine
Set a new color.

Specified by:
setColor in interface NiftyRenderEngine
Parameters:
colorParam - new current color to set

setColorAlpha

public void setColorAlpha(float newColorAlpha)
Description copied from interface: NiftyRenderEngine
set only the color alpha.

Specified by:
setColorAlpha in interface NiftyRenderEngine
Parameters:
newColorAlpha - new alpha value

setColorIgnoreAlpha

public void setColorIgnoreAlpha(Color color)
Description copied from interface: NiftyRenderEngine
Set only the color component of the given color. This assumes that alpha has already been changed.

Specified by:
setColorIgnoreAlpha in interface NiftyRenderEngine
Parameters:
color - color

isColorChanged

public boolean isColorChanged()
Description copied from interface: NiftyRenderEngine
return true when color has been changed.

Specified by:
isColorChanged in interface NiftyRenderEngine
Returns:
color changed

isColorAlphaChanged

public boolean isColorAlphaChanged()
Description copied from interface: NiftyRenderEngine
return true when color alpha has been changed.

Specified by:
isColorAlphaChanged in interface NiftyRenderEngine
Returns:
color changed

moveTo

public void moveTo(float param,
                   float param2)
Description copied from interface: NiftyRenderEngine
Move to the given x/y position.

Specified by:
moveTo in interface NiftyRenderEngine
Parameters:
param - x
param2 - y

renderImage

public void renderImage(NiftyImage image,
                        int x,
                        int y,
                        int width,
                        int height)
Description copied from interface: NiftyRenderEngine
Render Image.

Specified by:
renderImage in interface NiftyRenderEngine
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

renderQuad

public void renderQuad(int x,
                       int y,
                       int width,
                       int height)
Description copied from interface: NiftyRenderEngine
render a quad.

Specified by:
renderQuad in interface NiftyRenderEngine
Parameters:
x - x
y - y
width - width
height - height

renderQuad

public void renderQuad(int x,
                       int y,
                       int width,
                       int height,
                       Color topLeft,
                       Color topRight,
                       Color bottomRight,
                       Color bottomLeft)
Description copied from interface: NiftyRenderEngine
Renders a quad with different colors at the quad vertices.

Specified by:
renderQuad in interface NiftyRenderEngine

renderText

public void renderText(String text,
                       int x,
                       int y,
                       int selectionStart,
                       int selectionEnd,
                       Color c)
Description copied from interface: NiftyRenderEngine
renderText.

Specified by:
renderText in interface NiftyRenderEngine
Parameters:
text - text
x - x
y - y
selectionStart - selection start
selectionEnd - selection end
c - color for text selections

restoreState

public void restoreState()
Description copied from interface: NiftyRenderEngine
restore states.

Specified by:
restoreState in interface NiftyRenderEngine

saveState

public void saveState(RenderStates statesToSave)
Description copied from interface: NiftyRenderEngine
save given states.

Specified by:
saveState in interface NiftyRenderEngine
Parameters:
statesToSave - set of renderstates to save

setFont

public void setFont(RenderFont font)
Description copied from interface: NiftyRenderEngine
set font.

Specified by:
setFont in interface NiftyRenderEngine
Parameters:
font - font

getFont

public RenderFont getFont()
Description copied from interface: NiftyRenderEngine
get font.

Specified by:
getFont in interface NiftyRenderEngine
Returns:
font

setGlobalPosition

public void setGlobalPosition(float pos,
                              float pos2)
Description copied from interface: NiftyRenderEngine
set global position.

Specified by:
setGlobalPosition in interface NiftyRenderEngine
Parameters:
pos - x
pos2 - y

setImageScale

public void setImageScale(float scale)
Description copied from interface: NiftyRenderEngine
set image size.

Specified by:
setImageScale in interface NiftyRenderEngine
Parameters:
scale - new image size

setRenderTextSize

public void setRenderTextSize(float size)
Description copied from interface: NiftyRenderEngine
Set RenderTextSize.

Specified by:
setRenderTextSize in interface NiftyRenderEngine
Parameters:
size - size

setBlendMode

public void setBlendMode(BlendMode blendMode)
Description copied from interface: NiftyRenderEngine
Set BlendMode.

Specified by:
setBlendMode in interface NiftyRenderEngine

getRenderDevice

public RenderDevice getRenderDevice()
Description copied from interface: NiftyRenderEngine
Get RenderDevice.

Specified by:
getRenderDevice in interface NiftyRenderEngine
Returns:

disposeImage

public void disposeImage(RenderImage image)
Description copied from interface: NiftyRenderEngine
Dispose image.

Specified by:
disposeImage in interface NiftyRenderEngine
Parameters:
image - image to dispose

displayResolutionChanged

public void displayResolutionChanged()
Description copied from interface: NiftyRenderEngine
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.

Specified by:
displayResolutionChanged in interface NiftyRenderEngine

reset

public void reset()

getStates

public RenderStates getStates()

reload

public RenderImage reload(RenderImage image)
Description copied from interface: NiftyRenderEngine
Dispose the given image and reload it.

Specified by:
reload in interface NiftyRenderEngine
Parameters:
image - image
Returns:
the reloaded image

convertToNativeX

public int convertToNativeX(int x)
Specified by:
convertToNativeX in interface NiftyRenderEngine

convertToNativeY

public int convertToNativeY(int y)
Specified by:
convertToNativeY in interface NiftyRenderEngine

convertToNativeWidth

public int convertToNativeWidth(int x)
Specified by:
convertToNativeWidth in interface NiftyRenderEngine

convertToNativeHeight

public int convertToNativeHeight(int y)
Specified by:
convertToNativeHeight in interface NiftyRenderEngine

convertFromNativeX

public int convertFromNativeX(int x)
Specified by:
convertFromNativeX in interface NiftyRenderEngine

convertFromNativeY

public int convertFromNativeY(int y)
Specified by:
convertFromNativeY in interface NiftyRenderEngine

convertToNativeTextSizeX

public float convertToNativeTextSizeX(float size)
Specified by:
convertToNativeTextSizeX in interface NiftyRenderEngine

convertToNativeTextSizeY

public float convertToNativeTextSizeY(float size)
Specified by:
convertToNativeTextSizeY in interface NiftyRenderEngine

enableAutoScaling

public void enableAutoScaling(int baseResolutionX,
                              int baseResolutionY)
Specified by:
enableAutoScaling in interface NiftyRenderEngine

enableAutoScaling

public void enableAutoScaling(int baseResolutionX,
                              int baseResolutionY,
                              float scaleX,
                              float scaleY)
Specified by:
enableAutoScaling in interface NiftyRenderEngine

disableAutoScaling

public void disableAutoScaling()
Specified by:
disableAutoScaling in interface NiftyRenderEngine


Copyright © 2012. All Rights Reserved.