public class NiftyRenderEngineImpl extends Object implements NiftyRenderEngine
| Modifier and Type | Class and Description |
|---|---|
class |
NiftyRenderEngineImpl.Clip |
| Constructor and Description |
|---|
NiftyRenderEngineImpl(RenderDevice renderDeviceParam)
create the device.
|
| 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 filename)
Create a new RenderFont.
|
NiftyImage |
createImage(Screen screen,
String filename,
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.
|
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)
renderImage.
|
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.
|
protected void |
renderSelectionText(String text,
int x,
int y,
Color textColor,
Color textSelectionColor,
float textSizeX,
float textSizeY,
int selectionStartParam,
int selectionEndParam)
Render a Text with some text selected.
|
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 |
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 blendModeParam)
Set BlendMode.
|
void |
setColor(Color colorParam)
Set a new color.
|
void |
setColorAlpha(float newColorAlpha)
set only the color alpha.
|
void |
setColorIgnoreAlpha(Color newColor)
Set only the color component of the given color.
|
void |
setFont(RenderFont newFont)
set font.
|
void |
setGlobalPosition(float xPos,
float yPos)
set global position.
|
void |
setImageScale(float scale)
set image size.
|
void |
setRenderTextSize(float size)
Set RenderTextSize.
|
public NiftyRenderEngineImpl(RenderDevice renderDeviceParam)
renderDeviceParam - RenderDevicepublic int getWidth()
NiftyRenderEnginegetWidth in interface NiftyRenderEngineNiftyRenderEngine.getWidth()public int getHeight()
NiftyRenderEnginegetHeight in interface NiftyRenderEngineNiftyRenderEngine.getHeight()public void beginFrame()
NiftyRenderEnginebeginFrame in interface NiftyRenderEnginepublic void endFrame()
NiftyRenderEngineendFrame in interface NiftyRenderEnginepublic void clear()
NiftyRenderEngineclear in interface NiftyRenderEnginepublic NiftyImage createImage(Screen screen, String filename, boolean filterLinear)
NiftyRenderEnginecreateImage in interface NiftyRenderEnginescreen - the Screen this image is connected tofilename - file name to usefilterLinear - filterpublic RenderFont createFont(String filename)
NiftyRenderEnginecreateFont in interface NiftyRenderEnginefilename - nameNiftyRenderEngine.createFont(java.lang.String)public String getFontname(RenderFont font)
NiftyRenderEnginegetFontname in interface NiftyRenderEnginefont - RenderFont to get the name frompublic void renderQuad(int x,
int y,
int width,
int height)
NiftyRenderEnginerenderQuad in interface NiftyRenderEnginex - xy - ywidth - widthheight - heightNiftyRenderEngine.renderQuad(int, int, int, int)public void renderQuad(int x,
int y,
int width,
int height,
Color topLeft,
Color topRight,
Color bottomRight,
Color bottomLeft)
NiftyRenderEnginerenderQuad in interface NiftyRenderEnginepublic void renderImage(NiftyImage image, int x, int y, int width, int height)
renderImage in interface NiftyRenderEngineimage - imagex - xy - ywidth - widthheight - heightpublic void renderText(String text, int x, int y, int selectionStart, int selectionEnd, Color textSelectionColor)
renderText in interface NiftyRenderEnginetext - textx - xy - yselectionStart - selection startselectionEnd - selection endtextSelectionColor - textSelectionColorprotected void renderSelectionText(String text, int x, int y, Color textColor, Color textSelectionColor, float textSizeX, float textSizeY, int selectionStartParam, int selectionEndParam)
text - textx - xy - ytextColor - colortextSelectionColor - textSelectionColortextSize - text sizeselectionStartParam - selection startselectionEndParam - selection endpublic void setFont(RenderFont newFont)
setFont in interface NiftyRenderEnginenewFont - fontpublic RenderFont getFont()
getFont in interface NiftyRenderEnginepublic void setColor(Color colorParam)
NiftyRenderEnginesetColor in interface NiftyRenderEnginecolorParam - colorNiftyRenderEngine.setColor(de.lessvoid.nifty.tools.Color)public void setColorAlpha(float newColorAlpha)
setColorAlpha in interface NiftyRenderEnginenewColorAlpha - new alpha valuepublic void setColorIgnoreAlpha(Color newColor)
setColorIgnoreAlpha in interface NiftyRenderEnginenewColor - colorpublic boolean isColorChanged()
isColorChanged in interface NiftyRenderEnginepublic boolean isColorAlphaChanged()
NiftyRenderEngineisColorAlphaChanged in interface NiftyRenderEngineNiftyRenderEngine.isColorAlphaChanged()public void moveTo(float xParam,
float yParam)
NiftyRenderEnginemoveTo in interface NiftyRenderEnginexParam - xyParam - yNiftyRenderEngine.moveTo(float, float)public void enableClip(int x0,
int y0,
int x1,
int y1)
NiftyRenderEngineenableClip in interface NiftyRenderEnginex0 - x0y0 - y0x1 - x1y1 - y1NiftyRenderEngine.enableClip(int, int, int, int)public void disableClip()
NiftyRenderEnginedisableClip in interface NiftyRenderEngineNiftyRenderEngine.disableClip()public void setRenderTextSize(float size)
NiftyRenderEnginesetRenderTextSize in interface NiftyRenderEnginesize - sizeNiftyRenderEngine.setRenderTextSize(float)public void setImageScale(float scale)
NiftyRenderEnginesetImageScale in interface NiftyRenderEnginescale - scaleNiftyRenderEngine.setImageScale(float)public void setGlobalPosition(float xPos,
float yPos)
NiftyRenderEnginesetGlobalPosition in interface NiftyRenderEnginexPos - xyPos - yNiftyRenderEngine.setGlobalPosition(float, float)public void displayResolutionChanged()
NiftyRenderEnginedisplayResolutionChanged in interface NiftyRenderEnginepublic void saveState(RenderStates statesToSave)
NiftyRenderEnginesaveState in interface NiftyRenderEnginestatesToSave - set of renderstates to savepublic void restoreState()
NiftyRenderEnginerestoreState in interface NiftyRenderEnginepublic void setBlendMode(BlendMode blendModeParam)
NiftyRenderEnginesetBlendMode in interface NiftyRenderEnginepublic RenderDevice getRenderDevice()
NiftyRenderEnginegetRenderDevice in interface NiftyRenderEnginepublic void disposeImage(RenderImage image)
NiftyRenderEnginedisposeImage in interface NiftyRenderEngineimage - image to disposepublic RenderImage reload(RenderImage image)
NiftyRenderEnginereload in interface NiftyRenderEngineimage - imagepublic int getNativeWidth()
NiftyRenderEnginegetNativeWidth in interface NiftyRenderEnginepublic int getNativeHeight()
NiftyRenderEnginegetNativeHeight in interface NiftyRenderEnginepublic int convertToNativeX(int x)
convertToNativeX in interface NiftyRenderEnginepublic int convertToNativeY(int y)
convertToNativeY in interface NiftyRenderEnginepublic int convertToNativeWidth(int x)
convertToNativeWidth in interface NiftyRenderEnginepublic int convertToNativeHeight(int y)
convertToNativeHeight in interface NiftyRenderEnginepublic int convertFromNativeX(int x)
convertFromNativeX in interface NiftyRenderEnginepublic int convertFromNativeY(int y)
convertFromNativeY in interface NiftyRenderEnginepublic float convertToNativeTextSizeX(float size)
convertToNativeTextSizeX in interface NiftyRenderEnginepublic float convertToNativeTextSizeY(float size)
convertToNativeTextSizeY in interface NiftyRenderEnginepublic void enableAutoScaling(int baseResolutionX,
int baseResolutionY)
enableAutoScaling in interface NiftyRenderEnginepublic void enableAutoScaling(int baseResolutionX,
int baseResolutionY,
float scaleX,
float scaleY)
enableAutoScaling in interface NiftyRenderEnginepublic void disableAutoScaling()
disableAutoScaling in interface NiftyRenderEnginepublic void screenStarted(Screen screen)
NiftyRenderEnginescreenStarted in interface NiftyRenderEnginescreen - the screen that has just startedpublic void screenEnded(Screen screen)
NiftyRenderEnginescreenEnded in interface NiftyRenderEnginescreen - the screen that has just endedpublic void screensClear(Collection<Screen> screens)
NiftyRenderEnginescreensClear in interface NiftyRenderEnginescreens - the collection of Screens that will be removedpublic void screenAdded(Screen screen)
NiftyRenderEnginescreenAdded in interface NiftyRenderEnginescreen - the added Screenpublic void screenRemoved(Screen screen)
NiftyRenderEnginescreenRemoved in interface NiftyRenderEnginescreen - the removed ScreenCopyright © 2013. All Rights Reserved.