Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
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
- data ColorMode
- type FrameST s = Mutable Vector s Word32 -> ST s ()
- newtype FrameForall = FrameForall {
- unFrameForall :: forall s. FrameST s
- newtype FrameBase = FrameBase {
- unFrameBase :: forall s. ST s (Mutable Vector s Word32)
- type Frame = ((FrameBase, FrameForall), (OverlaySpace, OverlaySpace, OverlaySpace))
- type PreFrame3 = (PreFrame, (OverlaySpace, OverlaySpace, OverlaySpace))
- type PreFrames3 = [Maybe PreFrame3]
- type PreFrame = (Vector Word32, FrameForall)
- type PreFrames = [Maybe PreFrame]
- data SingleFrame = SingleFrame {}
- type OverlaySpace = [(PointUI, AttrString)]
- blankSingleFrame :: ScreenContent -> SingleFrame
- truncateOverlay :: Bool -> Int -> Int -> Bool -> Int -> Bool -> Overlay -> OverlaySpace
- overlayFrame :: Int -> OverlaySpace -> PreFrame -> PreFrame
- truncateAttrLine :: Bool -> Int -> Int -> AttrLine -> AttrString
Documentation
Color mode for the display.
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
.
FrameForall | |
|
Action that results in a base frame, to be modified further.
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.
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
Show SingleFrame Source # | |
Defined in Game.LambdaHack.Client.UI.Frame showsPrec :: Int -> SingleFrame -> ShowS # show :: SingleFrame -> String # showList :: [SingleFrame] -> ShowS # | |
Eq SingleFrame Source # | |
Defined in Game.LambdaHack.Client.UI.Frame (==) :: SingleFrame -> SingleFrame -> Bool # (/=) :: SingleFrame -> SingleFrame -> Bool # |
type OverlaySpace = [(PointUI, AttrString)] Source #
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.