public class NiftyRenderDeviceProxy extends Object implements NiftyRenderEngine
Constructor and Description |
---|
NiftyRenderDeviceProxy() |
Modifier and Type | Method and Description |
---|---|
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(Screen screen,
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 |
screenAdded(Screen screen)
The given Screen has been added.
|
void |
screenEnded(Screen screen)
Called by Nifty when the given screen has ended.
|
void |
screenRemoved(Screen screen)
The given Screen has been removed.
|
void |
screensClear(Collection<Screen> screens)
All screens are about to be removed because a new XML is being loaded.
|
void |
screenStarted(Screen screen)
Called by Nifty when the given screen has started.
|
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.
|
public void beginFrame()
NiftyRenderEngine
beginFrame
in interface NiftyRenderEngine
public void endFrame()
NiftyRenderEngine
endFrame
in interface NiftyRenderEngine
public void clear()
NiftyRenderEngine
clear
in interface NiftyRenderEngine
public RenderFont createFont(String name)
NiftyRenderEngine
createFont
in interface NiftyRenderEngine
name
- name of the fontpublic String getFontname(RenderFont font)
NiftyRenderEngine
getFontname
in interface NiftyRenderEngine
font
- RenderFont to get the name frompublic NiftyImage createImage(Screen screen, String name, boolean filterLinear)
NiftyRenderEngine
createImage
in interface NiftyRenderEngine
screen
- the Screen this image is connected toname
- file name to usefilterLinear
- filterpublic void disableClip()
NiftyRenderEngine
disableClip
in interface NiftyRenderEngine
public void enableClip(int x0, int y0, int x1, int y1)
NiftyRenderEngine
enableClip
in interface NiftyRenderEngine
x0
- x0y0
- y0x1
- x1y1
- y1public int getHeight()
NiftyRenderEngine
getHeight
in interface NiftyRenderEngine
public int getWidth()
NiftyRenderEngine
getWidth
in interface NiftyRenderEngine
public int getNativeWidth()
NiftyRenderEngine
getNativeWidth
in interface NiftyRenderEngine
public int getNativeHeight()
NiftyRenderEngine
getNativeHeight
in interface NiftyRenderEngine
public void setColor(Color colorParam)
NiftyRenderEngine
setColor
in interface NiftyRenderEngine
colorParam
- new current color to setpublic void setColorAlpha(float newColorAlpha)
NiftyRenderEngine
setColorAlpha
in interface NiftyRenderEngine
newColorAlpha
- new alpha valuepublic void setColorIgnoreAlpha(Color color)
NiftyRenderEngine
setColorIgnoreAlpha
in interface NiftyRenderEngine
color
- colorpublic boolean isColorChanged()
NiftyRenderEngine
isColorChanged
in interface NiftyRenderEngine
public boolean isColorAlphaChanged()
NiftyRenderEngine
isColorAlphaChanged
in interface NiftyRenderEngine
public void moveTo(float param, float param2)
NiftyRenderEngine
moveTo
in interface NiftyRenderEngine
param
- xparam2
- ypublic void renderImage(NiftyImage image, int x, int y, int width, int height)
NiftyRenderEngine
renderImage
in interface NiftyRenderEngine
image
- the image to renderx
- the x position on the screeny
- the y position on the screenwidth
- the widthheight
- the heightpublic void renderQuad(int x, int y, int width, int height)
NiftyRenderEngine
renderQuad
in interface NiftyRenderEngine
x
- xy
- ywidth
- widthheight
- heightpublic void renderQuad(int x, int y, int width, int height, Color topLeft, Color topRight, Color bottomRight, Color bottomLeft)
NiftyRenderEngine
renderQuad
in interface NiftyRenderEngine
public void renderText(String text, int x, int y, int selectionStart, int selectionEnd, Color c)
NiftyRenderEngine
renderText
in interface NiftyRenderEngine
text
- textx
- xy
- yselectionStart
- selection startselectionEnd
- selection endc
- color for text selectionspublic void restoreState()
NiftyRenderEngine
restoreState
in interface NiftyRenderEngine
public void saveState(RenderStates statesToSave)
NiftyRenderEngine
saveState
in interface NiftyRenderEngine
statesToSave
- set of renderstates to savepublic void setFont(RenderFont font)
NiftyRenderEngine
setFont
in interface NiftyRenderEngine
font
- fontpublic RenderFont getFont()
NiftyRenderEngine
getFont
in interface NiftyRenderEngine
public void setGlobalPosition(float pos, float pos2)
NiftyRenderEngine
setGlobalPosition
in interface NiftyRenderEngine
pos
- xpos2
- ypublic void setImageScale(float scale)
NiftyRenderEngine
setImageScale
in interface NiftyRenderEngine
scale
- new image sizepublic void setRenderTextSize(float size)
NiftyRenderEngine
setRenderTextSize
in interface NiftyRenderEngine
size
- sizepublic void setBlendMode(BlendMode blendMode)
NiftyRenderEngine
setBlendMode
in interface NiftyRenderEngine
public RenderDevice getRenderDevice()
NiftyRenderEngine
getRenderDevice
in interface NiftyRenderEngine
public void disposeImage(RenderImage image)
NiftyRenderEngine
disposeImage
in interface NiftyRenderEngine
image
- image to disposepublic void displayResolutionChanged()
NiftyRenderEngine
displayResolutionChanged
in interface NiftyRenderEngine
public void reset()
public RenderStates getStates()
public RenderImage reload(RenderImage image)
NiftyRenderEngine
reload
in interface NiftyRenderEngine
image
- imagepublic int convertToNativeX(int x)
convertToNativeX
in interface NiftyRenderEngine
public int convertToNativeY(int y)
convertToNativeY
in interface NiftyRenderEngine
public int convertToNativeWidth(int x)
convertToNativeWidth
in interface NiftyRenderEngine
public int convertToNativeHeight(int y)
convertToNativeHeight
in interface NiftyRenderEngine
public int convertFromNativeX(int x)
convertFromNativeX
in interface NiftyRenderEngine
public int convertFromNativeY(int y)
convertFromNativeY
in interface NiftyRenderEngine
public float convertToNativeTextSizeX(float size)
convertToNativeTextSizeX
in interface NiftyRenderEngine
public float convertToNativeTextSizeY(float size)
convertToNativeTextSizeY
in interface NiftyRenderEngine
public void enableAutoScaling(int baseResolutionX, int baseResolutionY)
enableAutoScaling
in interface NiftyRenderEngine
public void enableAutoScaling(int baseResolutionX, int baseResolutionY, float scaleX, float scaleY)
enableAutoScaling
in interface NiftyRenderEngine
public void disableAutoScaling()
disableAutoScaling
in interface NiftyRenderEngine
public void screenStarted(Screen screen)
NiftyRenderEngine
screenStarted
in interface NiftyRenderEngine
screen
- the screen that has just startedpublic void screenEnded(Screen screen)
NiftyRenderEngine
screenEnded
in interface NiftyRenderEngine
screen
- the screen that has just endedpublic void screensClear(Collection<Screen> screens)
NiftyRenderEngine
screensClear
in interface NiftyRenderEngine
screens
- the collection of Screens that will be removedpublic void screenAdded(Screen screen)
NiftyRenderEngine
screenAdded
in interface NiftyRenderEngine
screen
- the added Screenpublic void screenRemoved(Screen screen)
NiftyRenderEngine
screenRemoved
in interface NiftyRenderEngine
screen
- the removed ScreenCopyright © 2013. All Rights Reserved.