public interface NiftyRenderEngine
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.
|
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 |
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 xPos,
float yPos)
set global position.
|
void |
setImageScale(float scale)
set image size.
|
void |
setRenderTextSize(float size)
Set RenderTextSize.
|
int getWidth()
int getHeight()
int getNativeWidth()
int getNativeHeight()
void beginFrame()
void endFrame()
void clear()
NiftyImage createImage(Screen screen, String name, boolean filterLinear)
screen
- the Screen this image is connected toname
- file name to usefilterLinear
- filterRenderFont createFont(String name)
name
- name of the fontString getFontname(RenderFont font)
font
- RenderFont to get the name fromvoid renderQuad(int x, int y, int width, int height)
x
- xy
- ywidth
- widthheight
- heightvoid renderQuad(int x, int y, int width, int height, Color topLeft, Color topRight, Color bottomRight, Color bottomLeft)
x
- y
- width
- height
- topLeft
- topRight
- bottomRight
- bottomLeft
- void renderImage(NiftyImage image, int x, int y, int width, int height)
image
- the image to renderx
- the x position on the screeny
- the y position on the screenwidth
- the widthheight
- the heightvoid renderText(String text, int x, int y, int selectionStart, int selectionEnd, Color textSelectionColor)
text
- textx
- xy
- yselectionStart
- selection startselectionEnd
- selection endtextSelectionColor
- color for text selectionsvoid setFont(RenderFont font)
font
- fontRenderFont getFont()
void setColor(Color colorParam)
colorParam
- new current color to setvoid setColorAlpha(float newColorAlpha)
newColorAlpha
- new alpha valuevoid setColorIgnoreAlpha(Color color)
color
- colorboolean isColorChanged()
boolean isColorAlphaChanged()
void setBlendMode(BlendMode blendMode)
void moveTo(float xParam, float yParam)
xParam
- xyParam
- yvoid enableClip(int x0, int y0, int x1, int y1)
x0
- x0y0
- y0x1
- x1y1
- y1void disableClip()
void setRenderTextSize(float size)
size
- sizevoid setImageScale(float scale)
scale
- new image sizevoid setGlobalPosition(float xPos, float yPos)
xPos
- xyPos
- yvoid saveState(RenderStates statesToSave)
statesToSave
- set of renderstates to savevoid restoreState()
RenderDevice getRenderDevice()
void disposeImage(RenderImage image)
image
- image to disposeRenderImage reload(RenderImage image)
image
- imagevoid displayResolutionChanged()
void enableAutoScaling(int baseResolutionX, int baseResolutionY)
void enableAutoScaling(int baseResolutionX, int baseResolutionY, float scaleX, float scaleY)
void disableAutoScaling()
int convertToNativeX(int x)
int convertToNativeY(int y)
int convertToNativeWidth(int x)
int convertToNativeHeight(int y)
int convertFromNativeX(int x)
int convertFromNativeY(int y)
float convertToNativeTextSizeX(float size)
float convertToNativeTextSizeY(float size)
void screenStarted(Screen screen)
screen
- the screen that has just startedvoid screenEnded(Screen screen)
screen
- the screen that has just endedvoid screensClear(Collection<Screen> screens)
screens
- the collection of Screens that will be removedvoid screenAdded(Screen screen)
screen
- the added Screenvoid screenRemoved(Screen screen)
screen
- the removed ScreenCopyright © 2013. All Rights Reserved.