imj-base-0.1.0.2: Game engine with geometry, easing, animated text, delta rendering.

Safe HaskellNone
LanguageHaskell2010

Imj.Graphics.Class

Contents

Synopsis

Classes

A collection of classes representing graphical elements and their properties.

class HasLayeredColor a where Source #

Access one graphical element's LayeredColor.

Minimal complete definition

getColor

Methods

getColor :: a -> LayeredColor Source #

class Colorable a where Source #

A Colorable is a colourless graphical element.

Minimal complete definition

drawUsingColor

Methods

drawUsingColor :: (Draw e, MonadReader e m, MonadIO m) => a -> LayeredColor -> m () Source #

To draw a Colorable, we need to pass a LayeredColor.

class Drawable a where Source #

A Drawable is a graphical element that knows how to draw itself (it knows its color and position).

Minimal complete definition

draw

Methods

draw :: (Draw e, MonadReader e m, MonadIO m) => a -> m () Source #

Draw the Drawable

Instances

Colorable a => Drawable (Colored a) Source #

Colored can wrap a Colorable, to give it a notion of color.

Methods

draw :: (Draw e, MonadReader e m, MonadIO m) => Colored a -> m () Source #