wumpus-basic-0.16.0: Basic objects and system code built on Wumpus-Core.

PortabilityGHC
Stabilityhighly unstable
Maintainerstephen.tetley@gmail.com

Wumpus.Basic.Kernel.Objects.AdvanceGraphic

Contents

Description

Extended Graphic object - an AdvanceGraphic is a Graphic twinned with and advance vector.

Synopsis

Advance-vector graphic

type AdvGraphic u = LocImage u (Vec2 u)Source

Advance vector graphic - this partially models the PostScript show command which moves the current point by the advance (width) vector as each character is drawn.

intoAdvGraphic :: LocCF u (Vec2 u) -> LocGraphic u -> AdvGraphic uSource

intoAdvGraphic : loc_context_function * graphic -> Image

Build an AdvGraphic from a context function (CF) that generates the answer displacement vector and a LocGraphic that draws the AdvGraphic.

emptyAdvGraphic :: Num u => AdvGraphic uSource

emptyAdvGraphic : AdvGraphic

Build an empty AdvGraphic.

The emptyAdvGraphic is treated as a null primitive by Wumpus-Core and is not drawn, the answer vetor generated is the empty vector (V2 0 0).

Composition

advcat :: Num u => AdvGraphic u -> AdvGraphic u -> AdvGraphic uSource

Concatenate the two AdvGraphics.

advsep :: Num u => Vec2 u -> AdvGraphic u -> AdvGraphic u -> AdvGraphic uSource

Concatenate the two AdvGraphics spacing them by the supplied vector.

advconcat :: Num u => [AdvGraphic u] -> AdvGraphic uSource

Concatenate the list of AdvGraphic with advcat.

advspace :: Num u => Vec2 u -> [AdvGraphic u] -> AdvGraphic uSource

Concatenate the list of AdvGraphic with advsep.

advpunctuate :: Num u => AdvGraphic u -> [AdvGraphic u] -> AdvGraphic uSource

Concatenate the list of AdvGraphic with advsep.

advfill :: Num u => Vec2 u -> AdvGraphic u -> AdvGraphic uSource

Render the supplied AdvGraphic, but swap the result advance for the supplied vector. This function has behaviour analogue to fill in the wl-pprint library.