| Safe Haskell | None |
|---|---|
| Language | Haskell98 |
Graphics.Gloss.Data.ViewState
- data Command
- type CommandConfig = [(Command, [(Key, Maybe Modifiers)])]
- defaultCommandConfig :: CommandConfig
- data ViewState = ViewState {
- viewStateCommands :: !(Map Command [(Key, Maybe Modifiers)])
- viewStateScaleStep :: !Float
- viewStateRotateFactor :: !Float
- viewStateTranslateMark :: !(Maybe (Float, Float))
- viewStateRotateMark :: !(Maybe (Float, Float))
- viewStateViewPort :: ViewPort
- viewStateInit :: ViewState
- viewStateInitWithConfig :: CommandConfig -> ViewState
- updateViewStateWithEvent :: Event -> ViewState -> ViewState
- updateViewStateWithEventMaybe :: Event -> ViewState -> Maybe ViewState
Documentation
data Command
The commands suported by the view controller.
type CommandConfig = [(Command, [(Key, Maybe Modifiers)])]
defaultCommandConfig :: CommandConfig
The default commands. Left click pans, wheel zooms, right click rotates, "r" key resets.
data ViewState
State for controlling the viewport. These are used by the viewport control component.
Constructors
| ViewState | |
Fields
| |
The initial view state.
viewStateInitWithConfig :: CommandConfig -> ViewState
Initial view state, with user defined config.
updateViewStateWithEvent :: Event -> ViewState -> ViewState
Apply an event to a ViewState.
updateViewStateWithEventMaybe :: Event -> ViewState -> Maybe ViewState
Like updateViewStateWithEvent, but returns Nothing if no update
was needed.