|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectJTP.ScreenFrames
public class ScreenFrames
Responsible for drawing borders and frames, also provides dimensions to other game components.
Field Summary | |
---|---|
static int |
CTRL_DEFAULT
|
static int |
CTRL_EDITOR
|
static int |
CTRL_NONE
|
static int |
CTRL_P_ALTERNATE
|
static int |
CTRL_P_CHALLENGE
|
static int |
CTRL_P_NORMAL
|
static int |
CTRL_P_SIMULTANEOUS
|
static int |
RENDERING_BALANCED
|
static int |
RENDERING_QUALITY
|
static int |
RENDERING_SPEED
|
Constructor Summary | |
---|---|
ScreenFrames(Rectangle drawArea,
Rectangle gridFrame,
Rectangle ctrlFrame,
Point editorFrameSplit,
int gameCtrlTopFrameSize,
Point[] gameCtrlFrameSplit,
Color bgColor,
Color gridFrameColor,
Color ctrlFrameColor,
int borderSpacing,
int curvature,
int tileSize,
int heightPerLevel,
float frameThickness)
Creates a new ScreenFrames instance with the specified
parameters. |
Method Summary | |
---|---|
void |
drawAll(boolean background,
boolean thirdBox,
Graphics2D g)
Draws all frames (as currently configured) |
void |
drawAll(boolean background,
Graphics2D g)
Draws all frames (as currently configured) |
void |
drawGridFrame(boolean background,
Graphics2D g)
Only draws the frame around tile grid |
Color |
getBgColor()
Returns currently used background colour |
int |
getBorderSpacing()
Returns border spacing used (between frames and screen border) |
Color |
getCtrlFrameColor()
Returns colour of the control frame |
int |
getCtrlFrameType()
Returns the type of control frame in use |
Rectangle |
getCtrlOffset()
Returns default location of control frame |
Rectangle |
getDrawArea()
Returns size of draw area. |
Rectangle[] |
getEditorCtrlOffset()
Returns location of control frames as used in editor |
int |
getFrameThickness()
Returns thickness rounded up to the nearest integer (pixel) |
Rectangle |
getGameCtrlOffset(int index)
Returns location of a sub-control frame (in-game only) |
Rectangle |
getGridArea()
Returns dimensions of the tile grid. |
Rectangle |
getGridOffset()
Returns location of tile grid frame |
int |
getHeightPerLevel()
Returns height per tile |
Rectangle |
getOffset()
Returns offset from top-left window corner where to render tile grid (not frame) |
int |
getRenderQuality()
Used by other game components to determine how they should render. |
int |
getTileSize()
Returns width/height of tiles |
Rectangle |
getWholeDrawArea()
Returns size of whole screen. |
void |
setBgColor(Color c)
Sets the background colour to use |
void |
setCtrlFrameType(int type)
Sets the type of control frame to use |
void |
setRenderingHints(Graphics2D g,
boolean on)
Turns rendering options for the current graphics context on or off. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int RENDERING_SPEED
public static final int RENDERING_BALANCED
public static final int RENDERING_QUALITY
public static final int CTRL_NONE
public static final int CTRL_P_NORMAL
public static final int CTRL_P_CHALLENGE
public static final int CTRL_P_SIMULTANEOUS
public static final int CTRL_P_ALTERNATE
public static final int CTRL_DEFAULT
public static final int CTRL_EDITOR
Constructor Detail |
---|
public ScreenFrames(Rectangle drawArea, Rectangle gridFrame, Rectangle ctrlFrame, Point editorFrameSplit, int gameCtrlTopFrameSize, Point[] gameCtrlFrameSplit, Color bgColor, Color gridFrameColor, Color ctrlFrameColor, int borderSpacing, int curvature, int tileSize, int heightPerLevel, float frameThickness) throws NullPointerException, IllegalArgumentException
ScreenFrames
instance with the specified
parameters.
drawArea
- dimensions of the whole game screengridFrame
- dimensions of the tile gridctrlFrame
- dimensions of the status/button display (RHS)editorFrameSplit
- defines dimensions of the three editor control
frames (i.e. height of first two, third takes the rest)gameCtrlTopFrameSize
- defines dimensions of the top status frame
in-gamegameCtrlFrameSplit
- dimensions for the other in-game status frames
(normal, cahellgen, simultaneous, alternate)bgColor
- default background colourgridFrameColor
- colour of frame around tile gridctrlFrameColor
- colour of frame around status/control buttonsborderSpacing
- padding between frames and screen borderscurvature
- how curvy should the frame corners betileSize
- legacy option - should be set to 40heightPerLevel
- legacy option - should be set to 5frameThickness
- how thick should frames be
NullPointerException
IllegalArgumentException
Method Detail |
---|
public int getRenderQuality()
public void setCtrlFrameType(int type) throws IllegalArgumentException
type
- (e.g. CTRL_P_NORMAL
)
IllegalArgumentException
public int getCtrlFrameType()
public void drawAll(boolean background, Graphics2D g)
background
- should the background be cleared alsog
- graphics context for renderingpublic void drawAll(boolean background, boolean thirdBox, Graphics2D g)
background
- should the background be cleared alsothirdBox
- render third control frame?g
- graphics context for renderingpublic void setRenderingHints(Graphics2D g, boolean on)
RENDERING_BALANCED
mode.
g
- graphics context for renderingon
- should the hints be turned on or off?public void drawGridFrame(boolean background, Graphics2D g)
background
- should the background be cleared also?g
- graphics context for renderingpublic Rectangle getWholeDrawArea()
public Rectangle getDrawArea()
CTRL_NONE
, dimensions of tile grid.public Rectangle getOffset()
public Rectangle getGridOffset()
public Rectangle getCtrlOffset()
public Rectangle getGameCtrlOffset(int index) throws IndexOutOfBoundsException
index
- which sub-frame
null
if current ctrl setting is not one of the game
ones or the dimensions of the sub-frame
IndexOutOfBoundsException
public Rectangle[] getEditorCtrlOffset()
public int getBorderSpacing()
public void setBgColor(Color c) throws NullPointerException
c
- the new background colour to use
NullPointerException
public Color getBgColor()
public Color getCtrlFrameColor()
public int getTileSize()
public int getHeightPerLevel()
public Rectangle getGridArea()
public int getFrameThickness()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |