Orasund/pixelengine/4.3.0

NOTE: the latest version is 6.2.0

PixelEngine

This module takes care of all the wiring.

If you are looking for the main module, head over to PixelEngine.Graphics.

type alias PixelEngine flag model msg =
Program flag (Model model msg) (Msg msg)

An alias for a PixelEngine program.

Your main function will have this type.

{ init : flags -> ( model, Cmd msg )
, update : msg -> model -> ( model, Cmd msg )
, subscriptions : model -> Sub msg
, view :
model
-> { title : String
, options : Options msg
, body : List (Area msg)
}
, controls : Input -> msg
}
-> Program flags (Model model msg) (Msg msg)

A prewired PixelEngine frame.

Use it just like document from elm/browser.

{ init : flags -> ( model, Cmd msg )
, update : msg -> model -> ( model, Cmd msg )
, subscriptions : model -> Sub msg
, view :
model
-> { title : String
, options : Options msg
, body : List (Area msg)
}
}
-> Program flags (Model model msg) (Msg msg)

A game with no controls.

Use it just like document from elm/browser.

{ init : flags -> ( model, Cmd msg )
, update : msg -> model -> ( model, Cmd msg )
, subscriptions : model -> Sub msg
, view :
model
-> { title : String
, options : Options msg
, body : List (Area msg)
}
, controls : ( String -> Input, Input -> msg )
}
-> Program flags (Model model msg) (Msg msg)

A game using custom controls.

The default controls should be enough to start, but maybe you want to write a spelling game, or its nessesary that very specifc keys are used?