pub unsafe trait SCNAnimatable: NSObjectProtocol {
Show 14 methods
// Provided methods
unsafe fn addAnimation_forKey(
&self,
animation: &ProtocolObject<dyn SCNAnimationProtocol>,
key: Option<&NSString>,
)
where Self: Sized + Message { ... }
unsafe fn addAnimationPlayer_forKey(
&self,
player: &SCNAnimationPlayer,
key: Option<&NSString>,
)
where Self: Sized + Message { ... }
unsafe fn removeAllAnimations(&self)
where Self: Sized + Message { ... }
unsafe fn removeAllAnimationsWithBlendOutDuration(&self, duration: CGFloat)
where Self: Sized + Message { ... }
unsafe fn removeAnimationForKey(&self, key: &NSString)
where Self: Sized + Message { ... }
unsafe fn removeAnimationForKey_blendOutDuration(
&self,
key: &NSString,
duration: CGFloat,
)
where Self: Sized + Message { ... }
unsafe fn animationKeys(&self) -> Retained<NSArray<NSString>>
where Self: Sized + Message { ... }
unsafe fn animationPlayerForKey(
&self,
key: &NSString,
) -> Option<Retained<SCNAnimationPlayer>>
where Self: Sized + Message { ... }
unsafe fn removeAnimationForKey_fadeOutDuration(
&self,
key: &NSString,
duration: CGFloat,
)
where Self: Sized + Message { ... }
unsafe fn animationForKey(
&self,
key: &NSString,
) -> Option<Retained<CAAnimation>>
where Self: Sized + Message { ... }
unsafe fn pauseAnimationForKey(&self, key: &NSString)
where Self: Sized + Message { ... }
unsafe fn resumeAnimationForKey(&self, key: &NSString)
where Self: Sized + Message { ... }
unsafe fn setSpeed_forAnimationKey(&self, speed: CGFloat, key: &NSString)
where Self: Sized + Message { ... }
unsafe fn isAnimationForKeyPaused(&self, key: &NSString) -> bool
where Self: Sized + Message { ... }
}SCNAnimation only.Expand description
The SCNAnimatable protocol defines an animatable property. Objects that implement this protocol can be animated through these methods.
See also Apple’s documentation
Provided Methods§
Sourceunsafe fn addAnimation_forKey(
&self,
animation: &ProtocolObject<dyn SCNAnimationProtocol>,
key: Option<&NSString>,
)
unsafe fn addAnimation_forKey( &self, animation: &ProtocolObject<dyn SCNAnimationProtocol>, key: Option<&NSString>, )
Adds and runs an animation
Parameter animation: Added animation.
Parameter key: May be any string such that only one animation per unique key is added per animatable object.
Only SCNAnimation (preferred), CABasicAnimation, CAKeyframeAnimation and CAAnimationGroup are supported. The animation starts playing right away. The animation is automatically removed on completion unless if removedOnCompletion is explicitly set to NO.
See also: -[id <SCNAnimation
removedOnCompletion]
Sourceunsafe fn addAnimationPlayer_forKey(
&self,
player: &SCNAnimationPlayer,
key: Option<&NSString>,
)
unsafe fn addAnimationPlayer_forKey( &self, player: &SCNAnimationPlayer, key: Option<&NSString>, )
Add an animation player.
Parameter player: Added animation player.
Parameter key: May be any string such that only one animation per unique key is added per animatable object.
The animation player is not removed automatically on completion. The animation doesn’t start playing immediatelly. Call “play” on the player to start playing it.
See also: -[SCNAnimationPlayer play]
Sourceunsafe fn removeAllAnimations(&self)
unsafe fn removeAllAnimations(&self)
Remove all animations.
Sourceunsafe fn removeAllAnimationsWithBlendOutDuration(&self, duration: CGFloat)
Available on crate feature objc2-core-foundation only.
unsafe fn removeAllAnimationsWithBlendOutDuration(&self, duration: CGFloat)
objc2-core-foundation only.Smoothly remove all animations.
Parameter duration: The blend out duration used to remove the animation.
Sourceunsafe fn removeAnimationForKey(&self, key: &NSString)
unsafe fn removeAnimationForKey(&self, key: &NSString)
Remove the animation with the given identifier.
Parameter key: The identifier for the animation to remove.
Sourceunsafe fn removeAnimationForKey_blendOutDuration(
&self,
key: &NSString,
duration: CGFloat,
)
Available on crate feature objc2-core-foundation only.
unsafe fn removeAnimationForKey_blendOutDuration( &self, key: &NSString, duration: CGFloat, )
objc2-core-foundation only.Smoothly remove the animation with the given identifier.
Parameter key: The identifier for the animation to remove.
Parameter duration: The blend out duration used to remove the animation.
Sourceunsafe fn animationKeys(&self) -> Retained<NSArray<NSString>>
unsafe fn animationKeys(&self) -> Retained<NSArray<NSString>>
Returns an array containing the keys of all animations currently attached to the receiver.
Sourceunsafe fn animationPlayerForKey(
&self,
key: &NSString,
) -> Option<Retained<SCNAnimationPlayer>>
unsafe fn animationPlayerForKey( &self, key: &NSString, ) -> Option<Retained<SCNAnimationPlayer>>
Returns the animation player with the given identifier
Parameter key: The identifier for the animation player to retrieve.
This will return nil if no such animation player exists.
Sourceunsafe fn removeAnimationForKey_fadeOutDuration(
&self,
key: &NSString,
duration: CGFloat,
)
👎DeprecatedAvailable on crate feature objc2-core-foundation only.
unsafe fn removeAnimationForKey_fadeOutDuration( &self, key: &NSString, duration: CGFloat, )
objc2-core-foundation only.Smoothly remove the animation with the given identifier.
Parameter key: The identifier for the animation to remove.
Parameter duration: The fade out duration used to remove the animation.
Sourceunsafe fn animationForKey(
&self,
key: &NSString,
) -> Option<Retained<CAAnimation>>
👎DeprecatedAvailable on crate feature objc2-quartz-core and non-watchOS only.
unsafe fn animationForKey( &self, key: &NSString, ) -> Option<Retained<CAAnimation>>
objc2-quartz-core and non-watchOS only.Returns the animation with the given identifier
Parameter key: The identifier for the animation to retrieve.
This will return nil if no such animation exists. Attempting to modify any properties of the returned object will result in undefined behavior.
Sourceunsafe fn pauseAnimationForKey(&self, key: &NSString)
👎Deprecated: Use -[SCNAnimationPlayer setPaused:] instead
unsafe fn pauseAnimationForKey(&self, key: &NSString)
Pause the animation with the given identifier.
Parameter key: The identifier for the animation to pause.
Sourceunsafe fn resumeAnimationForKey(&self, key: &NSString)
👎Deprecated: Use -[SCNAnimationPlayer setPaused:] instead
unsafe fn resumeAnimationForKey(&self, key: &NSString)
Resume the animation with the given identifier.
Parameter key: The identifier for the animation to resume.
Sourceunsafe fn setSpeed_forAnimationKey(&self, speed: CGFloat, key: &NSString)
👎Deprecated: Use -[SCNAnimationPlayer setSpeed:] insteadAvailable on crate feature objc2-core-foundation only.
unsafe fn setSpeed_forAnimationKey(&self, speed: CGFloat, key: &NSString)
objc2-core-foundation only.Update the animation speed of the animation with the given identifier.
Parameter speed: The new speed of the animation.
Parameter key: The identifier for the animation to update.
Trait Implementations§
Source§impl ProtocolType for dyn SCNAnimatable
impl ProtocolType for dyn SCNAnimatable
impl<T> ImplementedBy<T> for dyn SCNAnimatable
Implementations on Foreign Types§
impl<T> SCNAnimatable for ProtocolObject<T>where
T: ?Sized + SCNAnimatable,
Implementors§
impl SCNAnimatable for SCNAccelerationConstraint
SCNConstraint only.impl SCNAnimatable for SCNAnimationPlayer
impl SCNAnimatable for SCNAvoidOccluderConstraint
SCNConstraint only.impl SCNAnimatable for SCNBillboardConstraint
SCNConstraint only.impl SCNAnimatable for SCNBox
SCNParametricGeometry only.impl SCNAnimatable for SCNCamera
SCNCamera only.impl SCNAnimatable for SCNCapsule
SCNParametricGeometry only.impl SCNAnimatable for SCNCone
SCNParametricGeometry only.impl SCNAnimatable for SCNConstraint
SCNConstraint only.impl SCNAnimatable for SCNCylinder
SCNParametricGeometry only.impl SCNAnimatable for SCNDistanceConstraint
SCNConstraint only.impl SCNAnimatable for SCNFloor
SCNParametricGeometry only.impl SCNAnimatable for SCNGeometry
SCNGeometry only.impl SCNAnimatable for SCNIKConstraint
SCNConstraint only.impl SCNAnimatable for SCNLight
SCNLight only.impl SCNAnimatable for SCNLookAtConstraint
SCNConstraint only.impl SCNAnimatable for SCNMaterial
SCNMaterial only.impl SCNAnimatable for SCNMaterialProperty
SCNMaterialProperty only.impl SCNAnimatable for SCNMorpher
SCNMorpher only.impl SCNAnimatable for SCNNode
SCNNode only.impl SCNAnimatable for SCNParticleSystem
SCNParticleSystem only.impl SCNAnimatable for SCNPlane
SCNParametricGeometry only.impl SCNAnimatable for SCNPyramid
SCNParametricGeometry only.impl SCNAnimatable for SCNReferenceNode
SCNReferenceNode only.impl SCNAnimatable for SCNReplicatorConstraint
SCNConstraint only.impl SCNAnimatable for SCNShape
SCNParametricGeometry only.impl SCNAnimatable for SCNSliderConstraint
SCNConstraint only.impl SCNAnimatable for SCNSphere
SCNParametricGeometry only.impl SCNAnimatable for SCNTechnique
SCNTechnique only.impl SCNAnimatable for SCNText
SCNParametricGeometry only.impl SCNAnimatable for SCNTorus
SCNParametricGeometry only.impl SCNAnimatable for SCNTransformConstraint
SCNConstraint only.impl SCNAnimatable for SCNTube
SCNParametricGeometry only.