LambdaHack-0.11.0.1: A game engine library for tactical squad ASCII roguelike dungeon crawlers
Safe HaskellSafe-Inferred
LanguageHaskell2010

Game.LambdaHack.Client.UI.Frame

Description

Screen frames.

Note that PointArray.Array here represents a screen frame and so screen positions are denoted by Point, contrary to the convention that Point refers to game map coordinates, as outlined in description of PointSquare that should normally be used in that role.

Synopsis

Documentation

data ColorMode Source #

Color mode for the display.

Constructors

ColorFull

normal, with full colours

ColorBW

black and white only

Instances

Instances details
Eq ColorMode Source # 
Instance details

Defined in Game.LambdaHack.Client.UI.Frame

type FrameST s = Mutable Vector s Word32 -> ST s () Source #

newtype FrameForall Source #

Efficiently composable representation of an operation on a frame, that is, on a mutable vector. When the composite operation is eventually performed, the vector is frozen to become a SingleFrame.

Constructors

FrameForall 

Fields

newtype FrameBase Source #

Action that results in a base frame, to be modified further.

Constructors

FrameBase 

Fields

type Frame = ((FrameBase, FrameForall), (OverlaySpace, OverlaySpace, OverlaySpace)) Source #

A frame, that is, a base frame and all its modifications.

type PreFrame3 = (PreFrame, (OverlaySpace, OverlaySpace, OverlaySpace)) Source #

Components of a frame, before it's decided if the first can be overwritten in-place or needs to be copied.

type PreFrames3 = [Maybe PreFrame3] Source #

Sequence of screen frames, including delays. Potentially based on a single base frame.

type PreFrame = (Vector Word32, FrameForall) Source #

A simpler variant of PreFrame3.

type PreFrames = [Maybe PreFrame] Source #

A simpler variant of PreFrames3.

data SingleFrame Source #

A frame that is padded to fill the whole screen with optional overlays to display in proportional, square and monospace fonts.

Note that we don't provide a list of color-highlighed box positions to be drawn separately, because overlays need to obscure not only map, but the highlights as well, so highlights need to be included earlier.

See the description of PointSquare for explanation of why screen coordinates in singleArray are Point even though they should be PointSquare.

Instances

Instances details
Show SingleFrame Source # 
Instance details

Defined in Game.LambdaHack.Client.UI.Frame

Eq SingleFrame Source # 
Instance details

Defined in Game.LambdaHack.Client.UI.Frame

truncateOverlay :: Bool -> Int -> Int -> Bool -> Int -> Bool -> Overlay -> OverlaySpace Source #

Truncate the overlay: for each line, if it's too long, it's truncated and if there are too many lines, excess is dropped and warning is appended. The width, in the second argument, is calculated in characters, not in UI (mono font) coordinates, so that taking and dropping characters is performed correctly.

overlayFrame :: Int -> OverlaySpace -> PreFrame -> PreFrame Source #

Overlays either the game map only or the whole empty screen frame. We assume the lines of the overlay are not too long nor too many.

Internal operations

truncateAttrLine :: Bool -> Int -> Int -> AttrLine -> AttrString Source #

Add a space at the message end, for display overlayed over the level map. Also trim (do not wrap!) too long lines. Also add many spaces when under longer lines.