Header menu logo Mibo

Program<'Model, 'Msg> Type

The Elmish program record that defines the complete game architecture.

A program ties together initialization, update logic, subscriptions, and rendering. Use the Program module functions to construct and configure programs.

Record fields

Record Field Description

Components

Full Usage: Components

Field type: (Game -> IGameComponent) list

List of MonoGame component factories.

Field type: (Game -> IGameComponent) list

Config

Full Usage: Config

Field type: (Game * GraphicsDeviceManager -> unit) list

List of configuration callbacks invoked in the game constructor. Use this to set resolution, vsync, window settings, etc.

Field type: (Game * GraphicsDeviceManager -> unit) list

DispatchMode

Full Usage: DispatchMode

Field type: DispatchMode

Controls when dispatched messages become eligible for processing.

See DispatchMode.

Field type: DispatchMode

FixedStep

Full Usage: FixedStep

Field type: FixedStepConfig<'Msg> voption

Optional framework-managed fixed timestep configuration.

Field type: FixedStepConfig<'Msg> voption

Init

Full Usage: Init

Field type: GameContext -> 'Model * Cmd<'Msg>

Creates initial model and commands when the game starts.

Field type: GameContext -> 'Model * Cmd<'Msg>

Renderers

Full Usage: Renderers

Field type: (Game -> IRenderer<'Model>) list

List of renderer factories for drawing.

Field type: (Game -> IRenderer<'Model>) list

Subscribe

Full Usage: Subscribe

Field type: GameContext -> 'Model -> Sub<'Msg>

Returns subscriptions based on current model state.

Field type: GameContext -> 'Model -> Sub<'Msg>

Tick

Full Usage: Tick

Field type: (GameTime -> 'Msg) voption

Optional function to generate a message each frame.

Field type: (GameTime -> 'Msg) voption

Update

Full Usage: Update

Field type: 'Msg -> 'Model -> 'Model * Cmd<'Msg>

Handles messages and returns updated model and commands.

Field type: 'Msg -> 'Model -> 'Model * Cmd<'Msg>

Type something to start searching.