Contents

EmphasizeAction

An action that performs an animation to call attention to an entity.

Declaration

struct EmphasizeAction

Overview

This action plays a preexisting animation, dependent on the style and motionType options.

The example below creates an animation that causes the entity to bounce in a playful style.

// An action that performs a bounce motion in a playful style.
let emphasizeAction = EmphasizeAction(motionType: .bounce,
                                      style: .playful,
                                      isAdditive: false)

// A five second animation that plays the preexisting animation.
//
// This animation causes the entity to raise up, and then drop,
// appearing to bounce on the ground in a playful style,
// before returning to its original position.
let playfulBounceAnimation = try AnimationResource
    .makeActionAnimation(for: emphasizeAction,
                         duration: 5.0,
                         bindTarget: .transform)

// Play the five second emphasize animation that causes the entity to
// bounce in a playful style.
entity.playAnimation(playfulBounceAnimation)

Topics

Initializers

Instance Properties

Enumerations

See Also

Built-in actions