LambdaHack-0.11.0.1: A game engine library for tactical squad ASCII roguelike dungeon crawlers

Safe Haskell | None
Language | Haskell2010

Game.LambdaHack.Client.UI.PointUI

Contents

- Internal operations

Description

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

data PointUI Source #

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.

Constructors

PointUI Int Int |

#### Instances

Instances details

Show PointUI Source # |
Instance details Defined in Game.LambdaHack.Client.UI.PointUI Methods showsPrec :: Int -> PointUI -> ShowS Source # show :: PointUI -> String Source # showList :: [PointUI] -> ShowS Source #
Eq PointUI Source # |
Instance details Defined in Game.LambdaHack.Client.UI.PointUI Methods (==) :: PointUI -> PointUI -> Bool Source # (/=) :: PointUI -> PointUI -> Bool Source #

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.

Constructors

PointSquare Int Int |

#### Instances

Instances details

Show PointSquare Source # |
Instance details Defined in Game.LambdaHack.Client.UI.PointUI Methods showsPrec :: Int -> PointSquare -> ShowS Source # show :: PointSquare -> String Source # showList :: [PointSquare] -> ShowS Source #
Eq PointSquare Source # |
Instance details Defined in Game.LambdaHack.Client.UI.PointUI Methods (==) :: PointSquare -> PointSquare -> Bool Source # (/=) :: PointSquare -> PointSquare -> Bool Source #

squareToUI :: PointSquare -> PointUI Source #

uiToSquare :: PointUI -> PointSquare Source #

squareToMap :: PointSquare -> Point Source #

mapToSquare :: Point -> PointSquare Source #

# Internal operations

mapStartY :: Int Source #

The row where the dungeon map starts, both in `PointUI` and `PointSquare` coordinates.