@Beta public class SGPanelGDX extends com.badlogic.gdx.scenes.scene2d.Group implements SGPane
Constructor and Description |
---|
SGPanelGDX() |
Modifier and Type | Method and Description |
---|---|
void |
clearCell(int x,
int y)
Clears the cell at the location given with the default background color.
|
void |
clearCell(int x,
int y,
java.awt.Color color)
Clears the cell at the location given with the provided color.
|
int |
getCellHeight()
Returns the height of a single cell.
|
int |
getCellWidth()
Returns the width of a single cell.
|
int |
getGridHeight()
Returns the height of the grid.
|
int |
getGridWidth()
Returns the width of the grid.
|
void |
initialize(int gridWidth,
int gridHeight,
java.awt.Font font)
Initializes the component with the supplied number of rows and columns.
|
void |
initialize(int cellWidth,
int cellHeight,
int gridWidth,
int gridHeight,
java.awt.Font font)
Initializes the component with the supplied values.
|
void |
placeCharacter(int x,
int y,
char c)
Sets one specific block to the given character.
|
void |
placeCharacter(int x,
int y,
char c,
java.awt.Color fore)
Sets the block at the given coordinates to contain the passed in
character drawn with the given foreground color.
|
void |
placeCharacter(int x,
int y,
char c,
java.awt.Color fore,
java.awt.Color back)
Sets one specific block to the given character with the given foreground
and background colors.
|
void |
placeHorizontalString(int xOffset,
int yOffset,
java.lang.String string)
Prints out a string starting at the given offset position.
|
void |
placeHorizontalString(int xOffset,
int yOffset,
java.lang.String string,
java.awt.Color foreground,
java.awt.Color background)
Prints out a string vertically starting at the given offset position and
traveling down.
|
void |
placeImage(int x,
int y,
com.badlogic.gdx.graphics.Pixmap image,
boolean foreground)
Places an image at the given grid coordinate.
|
void |
placeImage(int x,
int y,
java.lang.String key)
Places the image associated with the provided key at the given
coordinates.
|
void |
placeImage(int x,
int y,
java.lang.String key,
java.awt.Color background)
Places the image associated with the provided key at the given
coordinates.
|
void |
placeText(int xOffset,
int yOffset,
char[][] chars)
Sets the contents of the component to reflect the two dimensional
character array, starting at the given offset position.
|
void |
placeText(int xOffset,
int yOffset,
char[][] chars,
java.awt.Color foreground,
java.awt.Color background)
Sets the contents of the component to reflect the two dimensional
character array, starting at the given offset position.
|
void |
placeVerticalString(int xOffset,
int yOffset,
java.lang.String string)
Prints out a string vertically starting at the given offset position and
traveling down.
|
void |
placeVerticalString(int xOffset,
int yOffset,
java.lang.String string,
java.awt.Color foreground,
java.awt.Color background)
Prints out a string starting at the given offset position.
|
void |
refresh()
Signals that this component should update its display image.
|
void |
setCellBackground(int x,
int y,
java.awt.Color color)
Sets the background to the provided color.
|
void |
setDefaultBackground(java.awt.Color defaultBackground)
Sets the background color which will be used on all text and transparent
tiles when not other color is specified.
|
void |
setDefaultForeground(java.awt.Color defaultForeground)
Sets the background color which will be used on all text and transparent
tiles when not other color is specified.
|
void |
setText(char[][] chars)
Sets the contents of the component to reflect the two dimensional
character array.
|
boolean |
willFit(char character)
Test if the given character will fit in the current cell dimension using
the current Font.
|
act, addActor, addActorAfter, addActorAt, addActorBefore, applyTransform, childrenChanged, clear, computeTransform, draw, drawChildren, findActor, getChildren, hit, isTransform, localToDescendantCoordinates, removeActor, resetTransform, setCullingArea, setStage, setTransform, swapActor, swapActor
addAction, addCaptureListener, addListener, clearActions, fire, getActions, getCaptureListeners, getColor, getHeight, getListeners, getName, getOriginX, getOriginY, getParent, getRight, getRotation, getScaleX, getScaleY, getStage, getTop, getTouchable, getWidth, getX, getY, getZIndex, hasParent, isAscendantOf, isDescendantOf, isVisible, localToAscendantCoordinates, localToParentCoordinates, localToStageCoordinates, notify, parentToLocalCoordinates, remove, removeAction, removeCaptureListener, removeListener, rotate, scale, scale, screenToLocalCoordinates, setBounds, setColor, setColor, setHeight, setName, setOrigin, setOriginX, setOriginY, setParent, setPosition, setRotation, setScale, setScale, setScaleX, setScaleY, setSize, setTouchable, setVisible, setWidth, setX, setY, setZIndex, size, size, stageToLocalCoordinates, toBack, toFront, toString, translate
public int getCellHeight()
SGPane
getCellHeight
in interface SGPane
public int getCellWidth()
SGPane
getCellWidth
in interface SGPane
public int getGridHeight()
SGPane
getGridHeight
in interface SGPane
public int getGridWidth()
SGPane
getGridWidth
in interface SGPane
public void initialize(int cellWidth, int cellHeight, int gridWidth, int gridHeight, java.awt.Font font)
SGPane
initialize
in interface SGPane
cellWidth
- in pixelscellHeight
- in pixelsgridWidth
- in cellsgridHeight
- in cellspublic void initialize(int gridWidth, int gridHeight, java.awt.Font font)
SGPane
initialize
in interface SGPane
gridWidth
- in cellsgridHeight
- in cellspublic void clearCell(int x, int y)
SGPane
public void clearCell(int x, int y, java.awt.Color color)
SGPane
public void setCellBackground(int x, int y, java.awt.Color color)
SGPane
setCellBackground
in interface SGPane
public void placeCharacter(int x, int y, char c)
SGPane
placeCharacter
in interface SGPane
x
- The x coordinate to sety
- The y coordinate to setc
- The character to be displayedpublic void placeCharacter(int x, int y, char c, java.awt.Color fore, java.awt.Color back)
SGPane
placeCharacter
in interface SGPane
x
- The x coordinate to sety
- The y coordinate to setc
- The character to be displayedfore
- The foreground colorback
- The background colorpublic void placeCharacter(int x, int y, char c, java.awt.Color fore)
SGPane
placeCharacter
in interface SGPane
public void placeImage(int x, int y, java.lang.String key)
SGPane
placeImage
in interface SGPane
public void placeImage(int x, int y, java.lang.String key, java.awt.Color background)
SGPane
placeImage
in interface SGPane
public void placeImage(int x, int y, com.badlogic.gdx.graphics.Pixmap image, boolean foreground)
x
- y
- image
- foreground
- if true then the image will be placed in the foregroundpublic void placeText(int xOffset, int yOffset, char[][] chars)
SGPane
public void placeText(int xOffset, int yOffset, char[][] chars, java.awt.Color foreground, java.awt.Color background)
SGPane
public void placeHorizontalString(int xOffset, int yOffset, java.lang.String string)
SGPane
placeHorizontalString
in interface SGPane
public void placeHorizontalString(int xOffset, int yOffset, java.lang.String string, java.awt.Color foreground, java.awt.Color background)
SGPane
placeHorizontalString
in interface SGPane
public void placeVerticalString(int xOffset, int yOffset, java.lang.String string, java.awt.Color foreground, java.awt.Color background)
SGPane
placeVerticalString
in interface SGPane
public void placeVerticalString(int xOffset, int yOffset, java.lang.String string)
SGPane
placeVerticalString
in interface SGPane
public void refresh()
SGPane
public void setDefaultBackground(java.awt.Color defaultBackground)
SGPane
setDefaultBackground
in interface SGPane
public void setDefaultForeground(java.awt.Color defaultForeground)
SGPane
setDefaultForeground
in interface SGPane
public void setText(char[][] chars)
SGPane