Source File
animation.go
Belonging Package
github.com/pancsta/d2/d2renderers/d2scene
package d2sceneimport ()type AnimationProperty uint8const (AnimateOpacity AnimationProperty = iotaAnimateTransformAnimateStrokeDashOffsetAnimateFillColorAnimateStrokeColorAnimateDropShadow)type AnimationValueKind uint8const (NumberAnimationValue AnimationValueKind = iotaTransformAnimationValueColorAnimationValueShadowAnimationValue)// AnimationValue is a small tagged union so renderers must handle every value// kind explicitly. Unused fields are ignored.type AnimationValue struct {Kind AnimationValueKindNumber float64Transform MatrixColor color.NRGBAShadow DropShadow}func ( float64) AnimationValue {return AnimationValue{Kind: NumberAnimationValue, Number: }}func ( Matrix) AnimationValue {return AnimationValue{Kind: TransformAnimationValue, Transform: }}func ( color.NRGBA) AnimationValue {return AnimationValue{Kind: ColorAnimationValue, Color: }}func ( DropShadow) AnimationValue {return AnimationValue{Kind: ShadowAnimationValue, Shadow: }}type EasingKind uint8const (EaseLinear EasingKind = iotaEaseCubicBezierEaseStepStartEaseStepEnd)// Easing describes an outgoing keyframe easing. CubicBezier uses CSS-style// control points (0,0), (X1,Y1), (X2,Y2), (1,1).type Easing struct {Kind EasingKindX1 float64Y1 float64X2 float64Y2 float64}type Keyframe struct {Offset float64Value AnimationValueEasing Easing}// Track describes one typed animation. Repeat loops forever. Renderers resolve// tracks without changing the track or its node, so a scene can be rendered at// multiple times concurrently.type Track struct {Property AnimationProperty// TargetIndex selects an entry for indexed properties such as a drop// shadow in Node.Filters. It is zero for scalar node properties.TargetIndex intDelay time.DurationDuration time.DurationRepeat boolKeyframes []Keyframe}
![]() |
The pages are generated with Golds v0.8.7. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |