public interface IPanelBuilder
SquidPanel
by taking care of
adjusting the panel to the screen size and the available fonts.Modifier and Type | Interface and Description |
---|---|
static class |
IPanelBuilder.Skeleton
A partial implementation of
IPanelBuilder . |
Modifier and Type | Method and Description |
---|---|
int |
adjustCellSize(int sz) |
SquidPanel |
buildByCells(int hCells,
int vCells,
int cellWidth,
int cellHeight,
TextCellFactory tcf_)
Builds a panel by the number of requested cells.
|
SquidPanel |
buildScreenWide(int screenWidth,
int screenHeight,
int desiredCellSize,
TextCellFactory tcf)
This method builds a panel whose number of cells is such that the cell
size is close to
desiredCellSize . |
boolean |
cellSizeTooBig(int cellSize)
Method to check whether increasing the cell size is possible.
|
boolean |
cellSizeTooSmall(int cellSize)
Method to check whether decreasing the cell size is possible.
|
int |
fontSizeForCellSize(int cellSize) |
boolean |
hasFontForCellOfSize(int cellSize) |
boolean |
hasFontOfSize(int sz) |
SquidPanel buildScreenWide(int screenWidth, int screenHeight, int desiredCellSize, TextCellFactory tcf)
desiredCellSize
. This method only supports
square cells.screenWidth
- The screen's width, in number of pixels, as given by libgdx.screenHeight
- The screen's height, in number of pixels, as given by libgdx.desiredCellSize
- The cell size that you would like the panel to have. Width and
height cannot be different, because this method supports only
square cells.tcf
- The TextCellFactory
to use. Can be null
to
create the panel.SquidPanel buildByCells(int hCells, int vCells, int cellWidth, int cellHeight, TextCellFactory tcf_)
hCells
- The number of horizontal cells of the panel to build.vCells
- The number of vertical cells of the panel to build.cellWidth
- The width of a cell (in pixels).cellHeight
- The height of a cell (in pixels).tcf_
- The text cell factory to use, if any.int adjustCellSize(int sz)
sz
- sz
that can be displayed (i.e. for
which there's a font, according to
fontSizeForCellSize(int)
and hasFontOfSize(int)
).boolean cellSizeTooBig(int cellSize)
cellSize
- true
if cellSize
is too big.boolean cellSizeTooSmall(int cellSize)
cellSize
- true
if cellSize
is too small.boolean hasFontForCellOfSize(int cellSize)
cellSize
- cellSize
.int fontSizeForCellSize(int cellSize)
cellSize
- cellSize
.
Generally, it is cellSize
; but it can be less in case
glyphs are too large.boolean hasFontOfSize(int sz)
sz
- sz
is available.Copyright © 2012–2016. All rights reserved.