Game messages displayed on top of the screen for the player to read.
- type Msg = String
- moreMsg :: Msg
- yesnoMsg :: Msg
- padMsg :: X -> String -> String
- data Report
- emptyReport :: Report
- nullReport :: Report -> Bool
- singletonReport :: Msg -> Report
- addMsg :: Report -> Msg -> Report
- splitReport :: Report -> [String]
- renderReport :: Report -> String
- data History
- emptyHistory :: History
- singletonHistory :: Report -> History
- addReport :: Report -> History -> History
- renderHistory :: History -> Overlay
- takeHistory :: Int -> History -> History
- type Overlay = [String]
- splitOverlay :: Y -> Overlay -> [Overlay]
- stringByLocation :: X -> Y -> Overlay -> (String, PointXY -> Maybe Char)
Add spaces at the message end, for display overlayed over the level map. Also trims (does not wrap!) too long lines.
The type of a set of messages to show at the screen at once.
Split a messages into chunks that fit in one line. We assume the width of the messages line is the same as of level map.
Render history as many lines of text, wrapping if necessary.
A screenful of text lines. When displayed, they are trimmed, not wrapped and any lines below the lower screen edge are not visible.
Split an overlay into overlays that fit on the screen.
Returns a function that looks up the characters in the string by location. Takes the height of the display plus the string. Returns also the message to print at the top and number of screens required to display all of the string.