LambdaHack-0.2.1: A roguelike game engine in early and very active development

Safe HaskellSafe-Infered

Game.LambdaHack.Color

Contents

Description

Colours and text attributes.

Synopsis

Colours

data Color Source

Colours supported by the major frontends.

defBG, defFG :: ColorSource

The default colours, to optimize attribute setting.

isBright :: Color -> BoolSource

A helper for the terminal frontends that display bright via bold.

legalBG :: [Color]Source

Due to the limitation of the curses library used in the curses frontend, only these are legal backgrounds.

colorToRGB :: Color -> StringSource

Translationg to heavily modified Linux console color RGB values.

Text attributes and the screen

data Attr Source

Text attributes: foreground and backgroud colors.

Constructors

Attr 

Fields

fg :: !Color

foreground colour

bg :: !Color

backgroud color

Instances

defaultAttr :: AttrSource

The default attribute, to optimize attribute setting.

data AttrChar Source

Constructors

AttrChar 

Fields

acAttr :: !Attr
 
acChar :: !Char
 

data SingleFrame Source

The data sufficent to draw a single game screen frame.

Constructors

SingleFrame 

Fields

sfLevel :: ![[AttrChar]]

content of the screen, line by line

sfTop :: String

an extra line to show at the top

sfBottom :: String

an extra line to show at the bottom

Instances

type Animation = [IntMap AttrChar]Source

Animation is a list of frame modifications to play one by one, where each modification if a map from locations to level map symbols.