monomer-1.6.0.1: A GUI library for writing native Haskell applications.
Copyright(c) 2023 Ruslan Gadeev Francisco Vallarino
LicenseBSD-3-Clause (see the LICENSE file)
Maintainerfjvallarino@gmail.com
Stabilityexperimental
Portabilitynon-portable
Safe HaskellSafe-Inferred
LanguageHaskell2010

Monomer.Widgets.Animation.Transform

Description

Transform animation widget. Wraps a child widget whose content will be animated. Acts as a base for most animation widgets.

Messages:

  • Accepts an AnimationMsg, used to control the state of the animation.
transform t (Rect x y w h) =
  [ animTranslation $ Point tx ty
  , animScale $ Point sx sy
  ]

animTransform transform managed

With configuration options:

transform t (Rect x y w h) =
  [ animTranslation $ Point tx ty
  , animScale $ Point sx sy
  ]

animTransform_ [duration 2000, autoStart] transform managed

For usage examples, see:

Synopsis

Configuration

data TransformCfg s e Source #

Configuration options for transform:

Instances

Instances details
Monoid (TransformCfg s e) Source # 
Instance details

Defined in Monomer.Widgets.Animation.Transform

Semigroup (TransformCfg s e) Source # 
Instance details

Defined in Monomer.Widgets.Animation.Transform

Methods

(<>) :: TransformCfg s e -> TransformCfg s e -> TransformCfg s e #

sconcat :: NonEmpty (TransformCfg s e) -> TransformCfg s e #

stimes :: Integral b => b -> TransformCfg s e -> TransformCfg s e #

Show (TransformCfg s e) Source # 
Instance details

Defined in Monomer.Widgets.Animation.Transform

Default (TransformCfg s e) Source # 
Instance details

Defined in Monomer.Widgets.Animation.Transform

Methods

def :: TransformCfg s e #

Eq e => Eq (TransformCfg s e) Source # 
Instance details

Defined in Monomer.Widgets.Animation.Transform

Methods

(==) :: TransformCfg s e -> TransformCfg s e -> Bool #

(/=) :: TransformCfg s e -> TransformCfg s e -> Bool #

CmbAutoStart (TransformCfg s e) Source # 
Instance details

Defined in Monomer.Widgets.Animation.Transform

CmbDuration (TransformCfg s e) Millisecond Source # 
Instance details

Defined in Monomer.Widgets.Animation.Transform

WidgetEvent e => CmbOnFinished (TransformCfg s e) e Source # 
Instance details

Defined in Monomer.Widgets.Animation.Transform

Methods

onFinished :: e -> TransformCfg s e Source #

CmbOnFinishedReq (TransformCfg s e) s e Source # 
Instance details

Defined in Monomer.Widgets.Animation.Transform

Render transformations

data RenderTransform Source #

Possible render transformations:

animTranslation :: Point -> RenderTransform Source #

Translate by the given offset.

animScale :: Point -> RenderTransform Source #

Scale by the given size.

animRotation :: Double -> RenderTransform Source #

Rotate by the given angle.

animGlobalAlpha :: Double -> RenderTransform Source #

Apply the given alpha.

animScissor :: Rect -> RenderTransform Source #

Scissor to the given viewport.

Constructors

animTransform Source #

Arguments

:: WidgetEvent e 
=> Transformer

Transformations from time (in ms) and viewport.

-> WidgetNode s e

The child node.

-> WidgetNode s e

The created animation container.

Animates a widget through translation, scaling, rotation, transparency and scissor.

animTransform_ Source #

Arguments

:: WidgetEvent e 
=> [TransformCfg s e]

The config options.

-> Transformer

Transformations from time (in ms) and viewport.

-> WidgetNode s e

The child node.

-> WidgetNode s e

The created animation container.

Animates a widget through translation, scaling, rotation, transparency and scissor. Accepts config.