Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
UI screen coordinates.
Synopsis
- data PointUI = PointUI Int Int
- data PointSquare = PointSquare Int Int
- squareToUI :: PointSquare -> PointUI
- uiToSquare :: PointUI -> PointSquare
- squareToMap :: PointSquare -> Point
- mapToSquare :: Point -> PointSquare
- mapStartY :: Int
Documentation
UI screen coordinates, independent of whether square or monospace fonts are being placed on the screen (though square fonts are never placed on odd coordinates). These are not game map coordinates, becuse UI is larger and more fine-grained than just the game map.
data PointSquare Source #
Coordinates of the big square fonts. These are not game map coordinates,
because the latter are offset by mapStartY
and represented by Point
.
However, confusingly, Point
is also used for square font glyph coordinates,
though exclusively in context of rendered frames to be sent to a frontend,
namely PointArray.Array
, which is indexed by Point
and is a vector,
and so traditionally indexed starting from zero and not from minus one,
as would be needed for consistency.
Instances
Show PointSquare Source # | |
Defined in Game.LambdaHack.Client.UI.PointUI showsPrec :: Int -> PointSquare -> ShowS # show :: PointSquare -> String # showList :: [PointSquare] -> ShowS # | |
Eq PointSquare Source # | |
Defined in Game.LambdaHack.Client.UI.PointUI (==) :: PointSquare -> PointSquare -> Bool # (/=) :: PointSquare -> PointSquare -> Bool # |
squareToUI :: PointSquare -> PointUI Source #
uiToSquare :: PointUI -> PointSquare Source #
squareToMap :: PointSquare -> Point Source #
mapToSquare :: Point -> PointSquare Source #