public class ScreenSizeManager
extends java.lang.Object
(leftMargin,botMargin)
).Modifier and Type | Field and Description |
---|---|
int |
botMargin
The bottom margin, which has at most a 1 pixel difference with
topMargin . |
int |
cellHeight
A cell's height, as given at creation time.
|
int |
cellWidth
A cell's width, as given at creation time.
|
int |
hCells
The number of cells, vertically
|
int |
leftMargin
The left margin
|
int |
rightMargin
The right margin, which has at most a 1 pixel difference with
leftMargin . |
int |
screenHeight
The screen's height, as given at creation time.
|
int |
screenWidth
The screen's width, as given at creation time.
|
int |
topMargin
The top margin
|
int |
wCells
The number of cells, horizontally
|
Constructor and Description |
---|
ScreenSizeManager(int screenWidth,
int screenHeight,
int cellWidth,
int cellHeight)
A fresh size manager, for the given screen size and the given cell size.
|
Modifier and Type | Method and Description |
---|---|
ScreenSizeManager |
changeScreenSize(int x,
int y) |
void |
log() |
squidpony.squidmath.Coord |
toScreenSize() |
public final int screenWidth
public final int screenHeight
public final int topMargin
public final int botMargin
topMargin
.public final int leftMargin
public final int rightMargin
leftMargin
.public final int cellWidth
public final int cellHeight
public final int wCells
public final int hCells
public ScreenSizeManager(int screenWidth, int screenHeight, int cellWidth, int cellHeight)
screenWidth
- screenHeight
- cellWidth
- The desired cell width.cellHeight
- The desired cell height.java.lang.IllegalStateException
- If a size is negative.public void log()
public squidpony.squidmath.Coord toScreenSize()
public ScreenSizeManager changeScreenSize(int x, int y)
Copyright © Eben Howard 2012–2022. All rights reserved.