public class GGParams
extends java.lang.Object
implements java.io.Serializable
int nbHorzCells = (from EditText field after validation) int nbVertCells = (from EditText field after validation) GGParams params = new GGParams(nbHorzCells, nbVertCells, 0, Color.GREEN); Intent intent = new Intent(this, MyGame.class); intent.putExtra("Params", params); startActivity(intent); finish();GGParam constructors correspond completely to GameGrid constructors. The spawned GameGrid activity must use the default constructor (parameterless constructor or no declared constructor). When the GameGrid activity starts, it first checks if the "Params" extra field is defined and uses parameters from the extra bundle as if they were passed by the constructor.
<activity android:name="my.app.MyGame" />
MyParams params = (MyParams)getParams()and use the getters to retrieve your data.
Constructor and Description |
---|
GGParams()
Same as GGParams(boolean isFullScreen, WindowZoom windowZoom)
with isFullScreen = false and windowZoom = null,
so the graphics window is a square and images are not zoomed.
|
GGParams(boolean isFullScreen,
GameGrid.WindowZoom windowZoom)
Constructs a game activity with no active navigation buttons,
no visible grid (transparent) and no background image.
|
GGParams(GameGrid.WindowZoom windowZoom)
Same as GGParams(boolean isFullScreen, WindowZoom windowZoom) with
isFullScreen = false, so the graphics window is a square.
|
GGParams(int borderColor)
Same as GGParams(int borderColor, booolean isNavigation, boolean isFullscreen, WindowZoom windowZoom)
with isNavigation = false, isFullScreen = false and windowZoom = null,
so the graphics window is a square and images are not zoomed.
|
GGParams(int borderColor,
boolean isNavigation,
boolean isFullScreen,
GameGrid.WindowZoom windowZoom)
Constructs a game activity with no active navigation buttons,
no visible grid (transparent) and no background image.
|
GGParams(int borderColor,
GameGrid.WindowZoom windowZoom)
Same as GGParams(int borderColor, boolean isNavigation, boolean isFullscreen, WindowZoom windowZoom)
with isNavigation = false and isFullScreen = false, so the graphics window is a square.
|
GGParams(int nbHorzCells,
int nbVertCells,
GameGrid.CellZoom cellZoom)
Same as GGParams(int nbHorzCells, int nbVertCells, int cellSize),
but the grid size is adapted to fit the current screen and images are
zoomed automatically when loaded.
|
GGParams(int nbHorzCells,
int nbVertCells,
GameGrid.CellZoom cellZoom,
int gridColor)
Same as GGParams(int nbHorzCells, int nbVertCells, int cellSize,
int gridColor), but the grid size is adapted to fit the current screen
and images are zoomed automatically when loaded.
|
GGParams(int nbHorzCells,
int nbVertCells,
GameGrid.CellZoom cellZoom,
int gridColor,
boolean isNavigation)
Same as GGParams(int nbHorzCells, int nbVertCells, int cellSize,
int gridColor, boolean isNavigation), but the
grid size is adapted to fit the current screen
and images are zoomed automatically when loaded.
|
GGParams(int nbHorzCells,
int nbVertCells,
GameGrid.CellZoom cellZoom,
int gridColor,
java.lang.String bgImagePath,
boolean isNavigation)
Same as GGParams(int nbHorzCells, int nbVertCells, int cellSize,
int gridColor, String bgImagePath, boolean isNavigation), but the
grid size is adapted to fit the current screen
and images are zoomed automatically when loaded.
|
GGParams(int nbHorzCells,
int nbVertCells,
int cellSize)
Constructs a game activity with no active navigation buttons,
no visible grid (transparent) and no background image.
|
GGParams(int nbHorzCells,
int nbVertCells,
int cellSize,
int gridColor)
Constructs a game activity with no active navigation buttons
and possibly a visible grid, but no background image.
|
GGParams(int nbHorzCells,
int nbVertCells,
int cellSize,
int gridColor,
boolean isNavigation)
Constructs a game activity with possibly a visible grid,
possibly active navitation buttons, but no background image.
|
GGParams(int nbHorzCells,
int nbVertCells,
int cellSize,
int gridColor,
java.lang.String bgImagePath,
boolean isNavigation)
Constructs a game activity with possibly active navigation buttons,
possibly a visible grid and possibly a background image.
|
GGParams(java.lang.String bgImagePath)
Same as GGParams(String bgImagePath, boolean isNavigation,
boolean isFullScreen, WindowZoom windowZoom)
with isNavigation = false, isFullScreen = false and windowZoom = null,
so the graphics window is a square and images are not zoomed
|
GGParams(java.lang.String bgImagePath,
boolean isNavigation,
boolean isFullScreen,
GameGrid.WindowZoom windowZoom)
Constructs a game activity with no visible grid (transparent)
possibly a background image and possibly active navitation buttons.
|
GGParams(java.lang.String bgImagePath,
GameGrid.WindowZoom windowZoom)
Same as GGParams(String bgImagePath, boolean isNavigation,
boolean isFullScreen, WindowZoom windowZoom)
with isNavigation = false, isFullScreen = false,
so the graphics window is a square.
|
Modifier and Type | Method and Description |
---|---|
int |
getBorderColor()
Returns the color of the frame border.
|
int |
getCellSize()
Returns the cell size.
|
GameGrid.CellZoom |
getCellZoom()
Returns a reference to CellZoom for device adaptive zooming in
grid based games.
|
int |
getGridColor()
Returns the color of the grid.
|
int |
getNbHorzCells()
Returns the number of horizontal cells.
|
int |
getNbVertCells()
Returns the number of vertical cells.
|
GameGrid.WindowZoom |
getWindowZoom()
Returns a reference to WindowZoom for device adaptive zooming in
1 pixel games.
|
boolean |
isFullScreen()
Returns information about the full screen mode.
|
public GGParams()
public GGParams(GameGrid.WindowZoom windowZoom)
windowZoom
- a WindowZoom reference to define the zoom factor. Use
windowZoom(int windowSize) to create it; if null, the images are not zoomedpublic GGParams(boolean isFullScreen, GameGrid.WindowZoom windowZoom)
isFullScreen
- if true, the windows is the maximum rectangle that fits the screen;
otherwise it is the maximum square that fits the screenwindowZoom
- a WindowZoom reference to define the zoom factor. Use
windowZoom(int windowSize) to create it; if null, the images are not zoomedpublic GGParams(int borderColor)
borderColor
- the color of the borderpublic GGParams(int borderColor, GameGrid.WindowZoom windowZoom)
borderColor
- the color of the borderwindowZoom
- a WindowZoom reference to define the zoom factor. Use
windowZoom(int windowSize) to create it; if null, the images are not zoomedpublic GGParams(int borderColor, boolean isNavigation, boolean isFullScreen, GameGrid.WindowZoom windowZoom)
borderColor
- the color of the borderisFullScreen
- if true, the windows is the maximum rectangle that fits the screen;
otherwise it is the maximum square that fits the screenwindowZoom
- a WindowZoom reference to define the zoom factor. Use
windowZoom(int windowSize) to create it; if null, the images are not zoomedpublic GGParams(java.lang.String bgImagePath)
bgImagePath
- the path to a background image (if null, no background image)public GGParams(java.lang.String bgImagePath, GameGrid.WindowZoom windowZoom)
bgImagePath
- the path to a background image (if null, no background image)windowZoom
- a WindowZoom reference to define the zoom factor. Use
windowZoom(int windowSize) to create it; if null, the images are not zoomedpublic GGParams(java.lang.String bgImagePath, boolean isNavigation, boolean isFullScreen, GameGrid.WindowZoom windowZoom)
bgImagePath
- the path to a background image (if null, no background image)isNavigation
- if true, the standard smartphone's buttons are active for navigationisFullScreen
- if true, the windows is the maximum rectangle that fits the screen;
otherwise it is the maximum square that fits the screenwindowZoom
- a WindowZoom reference to define the zoom factor. Use
windowZoom(int windowSize) to create it; if null, the images are not zoomedpublic GGParams(int nbHorzCells, int nbVertCells, int cellSize)
nbHorzCells
- the number of horizontal cellsnbVertCells
- the number of vertical cellscellSize
- the requested cell size in pixels, if >0 the cell size
is fixed even if the game grid does not fit the screen,
if 0 the size is adjusted to fit the screen, changing when the screen is
turned. The cell size can be requested by calling getCellSize()public GGParams(int nbHorzCells, int nbVertCells, GameGrid.CellZoom cellZoom)
nbHorzCells
- the number of horizontal cellsnbVertCells
- the number of vertical cellscellZoom
- a CellZoom reference to define the zoom factor. Use
cellZoom(int cellSize) to create it; if null, the images are not zoomedpublic GGParams(int nbHorzCells, int nbVertCells, int cellSize, int gridColor)
nbHorzCells
- the number of horizontal cellsnbVertCells
- the number of vertical cellscellSize
- the requested cell size in pixels, if >0 the cell size
is fixed even if the game grid does not fit the screen,
if 0 the size is adjusted to fit the screen, changing when the screen is
turned. The cell size can be requested by calling getCellSize()gridColor
- the color of the grid (if Color.TRANSPARENT, no grid is shown)public GGParams(int nbHorzCells, int nbVertCells, GameGrid.CellZoom cellZoom, int gridColor)
nbHorzCells
- the number of horizontal cellsnbVertCells
- the number of vertical cellscellZoom
- a CellZoom reference to define the zoom factor. Use
cellZoom(int cellSize) to create it; if null, the images are not zoomedgridColor
- the color of the grid (if Color.TRANSPARENT, no grid is shown)public GGParams(int nbHorzCells, int nbVertCells, int cellSize, int gridColor, boolean isNavigation)
nbHorzCells
- the number of horizontal cellsnbVertCells
- the number of vertical cellscellSize
- the requested cell size in pixels, if >0 the cell size
is fixed even if the game grid does not fit the screen,
if 0 the size is adjusted to fit the screen, changing when the screen is
turned. The cell size can be requested by calling getCellSize()gridColor
- the color of the grid (if Color.TRANSPARENT, no grid is shown)isNavigation
- if true, the standard smartphone's buttons are active for navigationpublic GGParams(int nbHorzCells, int nbVertCells, GameGrid.CellZoom cellZoom, int gridColor, boolean isNavigation)
nbHorzCells
- the number of horizontal cellsnbVertCells
- the number of vertical cellscellZoom
- a CellZoom reference to define the zoom factor. Use
cellZoom(int cellSize) to create it; if null, the images are not zoomedgridColor
- the color of the grid (if Color.TRANSPARENT, no grid is shown)isNavigation
- if true, the standard smartphone's buttons are active for navigationpublic GGParams(int nbHorzCells, int nbVertCells, int cellSize, int gridColor, java.lang.String bgImagePath, boolean isNavigation)
nbHorzCells
- the number of horizontal cellsnbVertCells
- the number of vertical cellscellSize
- the requested cell size in pixels, if >0 the cell size
is fixed even if the game grid does not fit the screen,
if 0 the size is adjusted to fit the screen, changing when the screen is
turned. The cell size can be requested by calling getCellSize()gridColor
- the color of the grid (if Color.TRANSPARENT, no grid is shown)bgImagePath
- the path to a background image (if null, no background image)isNavigation
- if true, the standard smartphone's buttons are active for navigationpublic GGParams(int nbHorzCells, int nbVertCells, GameGrid.CellZoom cellZoom, int gridColor, java.lang.String bgImagePath, boolean isNavigation)
nbHorzCells
- the number of horizontal cellsnbVertCells
- the number of vertical cellscellZoom
- a CellZoom reference to define the zoom factor. Use
cellZoom(int cellSize) to create it; if null, the images are not zoomedgridColor
- the color of the grid (if Color.TRANSPARENT, no grid is shown)bgImagePath
- the path to a background image (if null, no background image)isNavigation
- if true, the standard smartphone's buttons are active for navigationpublic int getNbHorzCells()
public int getNbVertCells()
public int getCellSize()
public int getGridColor()
public int getBorderColor()
public boolean isFullScreen()
public GameGrid.WindowZoom getWindowZoom()
public GameGrid.CellZoom getCellZoom()