free-game-0.9.1: Create graphical applications for free

Portabilitynon-portable
Stabilityexperimental
MaintainerFumiaki Kinsohita <fumiexcel@gmail.com>
Safe HaskellNone

Graphics.UI.FreeGame.Util

Contents

Description

 

Synopsis

Combinators

notF :: Functor f => f Bool -> f BoolSource

A lifted not.

(<&&>) :: Applicative f => f Bool -> f Bool -> f BoolSource

A lifted '(&&)'.

(<||>) :: Applicative f => f Bool -> f Bool -> f BoolSource

A lifted '(||)'

Controlling

untick :: (Functor n, MonadFree (UI n) m) => Free (UI n) a -> m (Either (Free (UI n) a) a)Source

Extract the next frame of the action.

untickInfinite :: (Functor n, MonadFree (UI n) m) => Free (UI n) Void -> m (Free (UI n) Void)Source

An infinite version of untick.

Random

randomness :: (Random r, MonadFree (UI n) m) => (r, r) -> m rSource

Get a given range of value.

Helper

degrees :: Float -> FloatSource

Convert radians to degrees.

radians :: Float -> FloatSource

Convert degrees to radians.

sinCos :: Floating a => a -> V2 aSource

Create a unit vector from a direction.

Loading

loadPictureFromFile :: (Picture2D p, MonadFree (UI n) m) => FilePath -> m (p ())Source

Create a Picture from the given file.

loadBitmaps :: FilePath -> Q [Dec]Source

use with getDataFileName

loadBitmapsWith :: Name -> FilePath -> Q [Dec]Source

Load and define all pictures in the specified directory.