Class: CAEmitterCell

Inherits:
NSObject show all

Overview

The CAEmitterCell class represents one source of particles being emitted in a CAEmitterLayer. An emitter cell define the direction in which they emit and the properties of the emitted particles. Emitter cells can have an array of sub-cells, which lets the particles themselves emit particles.

Instance Attribute Summary (collapse)

Class Method Summary (collapse)

Instance Method Summary (collapse)

Methods inherited from NSObject

#!, #!=, #!~, #, #==, #===, #=~, #Rational, #__callee__, #__method__, #__send__, #__type__, `, alloc, allocWithZone:, #autoContentAccessingProxy, autoload, autoload?, autorelease_pool, #awakeAfterUsingCoder:, binding, block_given?, caller, cancelPreviousPerformRequestsWithTarget:, cancelPreviousPerformRequestsWithTarget:selector:object:, catch, class, classFallbacksForKeyedArchiver, #classForCoder, #classForKeyedArchiver, classForKeyedUnarchiver, #clone, conformsToProtocol:, #copy, copyWithZone:, #dealloc, #define_singleton_method, description, display, #doesNotRecognizeSelector:, #dup, #enum_for, #eql?, #equal?, #extend, fail, #finalize, format, #forwardInvocation:, #forwardingTargetForSelector:, framework, #freeze, #frozen?, getpass, gets, global_variables, #init, initialize, #initialize_clone, #initialize_copy, #initialize_dup, #inspect, instanceMethodForSelector:, instanceMethodSignatureForSelector:, #instance_eval, #instance_exec, #instance_of?, #instance_variable_defined?, #instance_variable_get, #instance_variable_set, #instance_variables, instancesRespondToSelector:, isSubclassOfClass:, #is_a?, iterator?, #kind_of?, lambda, load, load_bridge_support_file, load_plist, local_variables, loop, #method, #methodForSelector:, #methodSignatureForSelector:, #methods, #mutableCopy, mutableCopyWithZone:, new, #nil?, open, p, #performSelector:onThread:withObject:waitUntilDone:, #performSelector:onThread:withObject:waitUntilDone:modes:, #performSelector:withObject:afterDelay:, #performSelector:withObject:afterDelay:inModes:, #performSelectorInBackground:withObject:, #performSelectorOnMainThread:withObject:waitUntilDone:, #performSelectorOnMainThread:withObject:waitUntilDone:modes:, print, printf, #private_methods, proc, #protected_methods, #public_method, #public_methods, #public_send, putc, puts, raise, rand, readline, readlines, #replacementObjectForCoder:, #replacementObjectForKeyedArchiver:, require, resolveClassMethod:, resolveInstanceMethod:, #respond_to?, #respond_to_missing?, select, #send, setVersion:, #singleton_methods, sprintf, srand, superclass, #taint, #tainted?, #tap, test, throw, #to_plist, #to_s, trace_var, trap, #trust, #untaint, untrace_var, #untrust, #untrusted?, version

Constructor Details

This class inherits a constructor from NSObject

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class NSObject

Instance Attribute Details

- (Float) alphaRange

Specifies the range the alpha color component of the cell can vary. Animatable. The range specifies the mean amount the alpha component of the color property can vary for the cell. Default is 0.0.

Returns:

- (Float) alphaSpeed

The speed, in seconds, at which the alpha color component changes over the lifetime of the cell. Animatable. The speed change is defined as the rate of change per second. Defaults to 0.

Returns:

- (Float) birthRate

Number of emitted objects created every second. Animatable. Default value is 0.

Returns:

- (Float) blueRange

Specifies the range the blue color component of the cell can vary. Animatable. The range specifies the mean amount the blue component of the color property can vary for the cell.Default value is 0.0.

Returns:

- (Float) blueSpeed

The speed, in seconds, at which the green color component changes over the lifetime of the cell. Animatable. The speed change is defined as the rate of change per second. Defaults to 0.

Returns:

- (CGColorRef) color

Determines the color of each emitted object. Animatable. The specified color of the cell will vary by a random amount within the redRange, greenRange, blueRange and alphaRangevalues over the lifetime of the cell. The redSpeed, greenSpeed, blueSpeed, and alphaSpeed determine the rate of change.Defaults to opaque white.

Returns:

  • (CGColorRef)

- (Object) contents

An object that provides the contents of the layer. Animatable. A layer can set this property to a CGImageRef to display the image as its contents. Default value is nil.

Returns:

- (CGRect) contentsRect

A rectangle, in the unit coordinate space, defining the subrectangle of contents that the receiver should draw. Animatable. Defaults to the unit rectangle (0.0,0.0,1.0,1.0).If pixels outside the unit rectangles are requested, the edge pixels of the contents image will be extended outwards.If an empty rectangle is provided, the results are undefined.

Returns:

- (Float) emissionLatitude

Defines the latitudinal orientation of the emission angle. Animatable. The emission latitude is the orientation of the emission angle from the z-axis. It is also referred to as the colatitude. Default is 0.0.

Returns:

- (Float) emissionLongitude

Defines the longitudinal orientation of the emission angle. Animatable. The emission longitude is the orientation of the emission angle in the xy-plane. it is also often referred to as the azimuth.Default is 0.0.

Returns:

- (Float) emissionRange

An angle, in radians, defining a cone around the emission angle. Animatable. Cells are uniformly distributed across this cone.Defaults to 0.

Returns:

- (Array) emitterCells

An optional array containing the sub-cells of this cell. When specified, each particle emitted by the cell will act as an emitter for each of the cell's sub-cells. The emission point is the current particle position and the emission angle is relative to the current direction of the particle.Default is nil.

Returns:

- (Boolean) enabled

Determines whether or not cells from this emitter are rendered. Default is YES.

Returns:

  • (Boolean)

- (Float) greenRange

Specifies the range the green color component of the cell can vary. Animatable. The range specifies the mean amount the green component of the color property can vary for the cell.Default is 0.0.

Returns:

- (Float) greenSpeed

The speed, in seconds, at which the green color component changes over the lifetime of the cell. Animatable. The speed change is defined as the rate of change per second. Defaults to 0.

Returns:

- (Float) lifetime

The lifetime of the cell, in seconds. Animatable. The lifetime of the cell will vary by a random amount with the range specified by lifetimeRange.Default is 0.0.

Returns:

- (Float) lifetimeRange

Specifies the mean value the lifetime of the cell can vary. Animatable. If the lifetimeRange is 3 seconds, and the lifetime of the cell is 10 seconds, the cell’s actual lifetime will be between 7 and 13 seconds.Default is 0.0.

Returns:

- (String) magnificationFilter

The filter used when increasing the size of the content. The possible values for magnificationFilter are shown in Scaling_Filters. The default value is kCAFilterLinear.

Returns:

- (String) minificationFilter

The filter used when reducing the size of the content. The possible values for minifcationFilter are shown in Scaling_Filters. The default value is kCAFilterLinear.

Returns:

- (Float) minificationFilterBias

The bias factor used by the minification filter to determine the levels of detail. This value is used by the minificationFilter when it is set to kCAFilterTrilinear.Defaults to 0.

Returns:

- (String) name

The name of the cell. The cell name is used when constructing animation key paths that reference the cell. Defaults to nil.For example, adding an animation to a cell’s enclosing layer with the a keypath such as emitterCells.myCellName.redRange would animate the redRange propery of the cell in the layer’s emitterCells array with the name myCellName.

Returns:

- (Float) redRange

Specifies the range the red color component of the cell can vary. Animatable. The range specifies the mean amount the red component of the color property can vary for the cell.Default is 0.0.

Returns:

- (Float) redSpeed

The speed, in seconds, at which the red color component changes over the lifetime of the cell. Animatable. The speed change is defined as the rate of change per second. Defaults to 0.

Returns:

- (Float) scale

Specifies the scale factor applied to the cell. Animatable. The scale of the cell will vary by a random amount with the range specified by scaleRange. The scaleSpeed property determines the rate of change. Default is 0.0.

Returns:

- (Float) scaleRange

Specifies the range the blue color component of the cell can vary. Animatable. The range specifies the mean amount the scale value can vary for the cell over its lifetime. The scaleSpeed property determines the rate of change.

Returns:

- (Float) scaleSpeed

The speed, in seconds, at which the scale changes over the lifetime of the cell. Animatable. The speed change is defined as the rate of change per second.Defaults to 0.

Returns:

- (Float) spin

Specifies the rotation velocity per second, in radians, applied to the cell. Animatable. The spin of the cell will vary by a random amount with the range specified by spinRange. Default is 0.0.

Returns:

- (Float) spinRange

Specifies the range the spin of the cell can vary over its lifetime. Animatable. The range specifies the mean amount the spin value can vary over the cell's lifetime. Default value is 0.0.

Returns:

- (Hash) style

An optional dictionary referenced to find property values that aren’t explicitly defined by the receiver. This dictionary may in turn have a style key, forming a hierarchy of default values. In the case of hierarchical style dictionaries the shallowest value for a property is used. For example, the value for “style.someValue” takes precedence over “style.style.someValue”.If the style dictionary doesn’t define a value for an attribute, the cell’s defaultValueForKey: class method is called. Defaults to nil.The style dictionary is not consulted for the following keys: bounds, frame.Warning: If the style dictionary or any of its ancestors are modified, the values of the cell’s properties are undefined until the style property is reset.

Returns:

- (Float) velocity

Specifies the initial velocity of the cell. Animatable. The velocity of the cell will vary by a random amount within the range specified by velocityRange.

Returns:

- (Float) velocityRange

Specifies the range the velocity of the cell can vary. Animatable. The range specifies the mean amount the initial velocity value change.Default is 0.0.

Returns:

- (Float) xAcceleration

Specifies the x component of an acceleration vector applied to cell. Default is 0.0.

Returns:

- (Float) yAcceleration

Specifies the y component of an acceleration vector applied to cell. Default is 0.0.

Returns:

- (Float) zAcceleration

Specifies the z component of an acceleration vector applied to cell. Default is 0.0.

Returns:

Class Method Details

+ (Object) defaultValueForKey(key)

Specifies the default value of the property with the specified key. If this method returns nil a suitable “zero” default value for the property is provided, based on the declared type of the key. For example, if key is a CGSize object, a size of (0.0,0.0) is returned. For a CGRect an empty rectangle is returned. For CGAffineTransform and CATransform3D, the appropriate identity matrix is returned.

Parameters:

  • key (String)

    The name of one of the receiver’s properties.

Returns:

  • (Object)

    The default value for the named property. Returns nil if no default value has been set.

+ (Object) emitterCell

Creates and returns an instance of CAEmitterCell.

Returns:

  • (Object)

    The initialized CAEmitterCell object or nil if initialization is not successful.

Instance Method Details

- (Boolean) shouldArchiveValueForKey(key)

Specifies whether the value of the property for a given key is archived. The default implementation returns YES. Called by the object's implementation of encodeWithCoder:.

Parameters:

  • key (String)

    The name of one of the receiver’s properties.

Returns:

  • (Boolean)

    YES if the specified property should be archived, otherwise NO.