Package apple.spritekit
Class SKFieldNode
- java.lang.Object
-
- org.moe.natj.general.NativeObject
-
- org.moe.natj.objc.ObjCObject
-
- apple.NSObject
-
- apple.uikit.UIResponder
-
- apple.spritekit.SKNode
-
- apple.spritekit.SKFieldNode
-
- All Implemented Interfaces:
NSCoding,NSCopying,NSSecureCoding,NSObject,UIFocusEnvironment,UIFocusItem,UIPasteConfigurationSupporting,UIResponderStandardEditActions,UIUserActivityRestoring
public class SKFieldNode extends SKNode
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class apple.spritekit.SKNode
SKNode.Block_enumerateChildNodesWithNameUsingBlock, SKNode.Block_runActionCompletion
-
Nested classes/interfaces inherited from class apple.NSObject
NSObject.Function_instanceMethodForSelector_ret, NSObject.Function_methodForSelector_ret
-
Nested classes/interfaces inherited from interface apple.uikit.protocol.UIResponderStandardEditActions
UIResponderStandardEditActions.Block_updateTextAttributesWithConversionHandler
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedSKFieldNode(org.moe.natj.general.Pointer peer)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean_supportsSecureCoding()This property must return YES on all classes that allow secure coding.static booleanaccessInstanceVariablesDirectly()static SKFieldNodealloc()static java.lang.ObjectallocWithZone(org.moe.natj.general.ptr.VoidPtr zone)floatanimationSpeed()fields that can be animated can have non zero values.static booleanautomaticallyNotifiesObserversForKey(java.lang.String key)static voidcancelPreviousPerformRequestsWithTarget(java.lang.Object aTarget)static voidcancelPreviousPerformRequestsWithTargetSelectorObject(java.lang.Object aTarget, org.moe.natj.objc.SEL aSelector, java.lang.Object anArgument)intcategoryBitMask()Logical categories the field belongs to.static NSArray<java.lang.String>classFallbacksForKeyedArchiver()static org.moe.natj.objc.ClassclassForKeyedUnarchiver()static voidclearTextInputContextIdentifier(java.lang.String identifier)static java.lang.StringdebugDescription_static()static java.lang.Stringdescription_static()static SKFieldNodedragField()Slows an object proportionally to the object’s velocity.static SKFieldNodeelectricField()A force proportional to the charge on the object.floatfalloff()The falloff exponent used to calculate field strength at a distance.static longhash_static()SKFieldNodeinit()SKFieldNodeinitWithCoder(NSCoder aDecoder)NS_DESIGNATED_INITIALIZERstatic NSObject.Function_instanceMethodForSelector_retinstanceMethodForSelector(org.moe.natj.objc.SEL aSelector)static NSMethodSignatureinstanceMethodSignatureForSelector(org.moe.natj.objc.SEL aSelector)static booleaninstancesRespondToSelector(org.moe.natj.objc.SEL aSelector)booleanisEnabled()If enabled, a field has an effect.booleanisExclusive()If a field is exclusive, it suppresses any other field in its region of effect.static booleanisSubclassOfClass(org.moe.natj.objc.Class aClass)static NSSet<java.lang.String>keyPathsForValuesAffectingValueForKey(java.lang.String key)static SKFieldNodemagneticField()A force proportional to the charge on the object and the object’s velocity.floatminimumRadius()minimum radius of effect.static java.lang.Objectnew_objc()static SKFieldNodenode()static SKFieldNodenodeWithFileNamed(java.lang.String filename)static SKFieldNodenodeWithFileNamedSecurelyWithClassesAndError(java.lang.String filename, NSSet<? extends org.moe.natj.objc.Class> classes, org.moe.natj.general.ptr.Ptr<NSError> error)static SKFieldNodenoiseFieldWithSmoothnessAnimationSpeed(double smoothness, double speed)A time varying differentiable Perlin simplex noise field.static NSArray<? extends GKPolygonObstacle>obstaclesFromNodeBounds(NSArray<? extends SKNode> nodes)static NSArray<? extends GKPolygonObstacle>obstaclesFromNodePhysicsBodies(NSArray<? extends SKNode> nodes)static NSArray<? extends GKPolygonObstacle>obstaclesFromSpriteTexturesAccuracy(NSArray<? extends SKNode> sprites, float accuracy)static SKFieldNoderadialGravityField()Applies a force in the direction of the origin of the field in local space.SKRegionregion()The region property is the domain of the field's effect.static booleanresolveClassMethod(org.moe.natj.objc.SEL sel)static booleanresolveInstanceMethod(org.moe.natj.objc.SEL sel)voidsetAnimationSpeed(float value)fields that can be animated can have non zero values.voidsetCategoryBitMask(int value)Logical categories the field belongs to.voidsetEnabled(boolean value)If enabled, a field has an effect.voidsetExclusive(boolean value)If a field is exclusive, it suppresses any other field in its region of effect.voidsetFalloff(float value)The falloff exponent used to calculate field strength at a distance.voidsetMinimumRadius(float value)minimum radius of effect.voidsetRegion(SKRegion value)The region property is the domain of the field's effect.voidsetSmoothness(float value)fields without a smoothness component will return 0voidsetStrength(float value)strength scaling value. default 1.0voidsetTexture(SKTexture value)fields constructed with a texture can be uppdated by assigning a new texturestatic voidsetVersion_static(long aVersion)floatsmoothness()fields without a smoothness component will return 0static SKFieldNodespringField()A Hooke’s law force - a force linearly proportional to distance from the center of the field.floatstrength()strength scaling value. default 1.0static org.moe.natj.objc.Classsuperclass_static()static booleansupportsSecureCoding()SKTexturetexture()fields constructed with a texture can be uppdated by assigning a new texturestatic SKFieldNodeturbulenceFieldWithSmoothnessAnimationSpeed(double smoothness, double speed)Just like Noise, except the strength of the noise is proportional to the velocity of the object in the field.static SKFieldNodevelocityFieldWithTexture(SKTexture velocityTexture)The supplied texture contains velocity values for any object entering the field’s area of effect.static longversion_static()static SKFieldNodevortexField()Applies a force tangential to the direction from the sample point to the field's position.-
Methods inherited from class apple.spritekit.SKNode
actionForKey, addChild, alpha, attributeValues, calculateAccumulatedFrame, canBecomeFocused, childNodeWithName, children, constraints, containsPoint, convertPointFromNode, convertPointToNode, copyWithZone, didHintFocusMovement, didUpdateFocusInContextWithAnimationCoordinator, encodeWithCoder, entity, enumerateChildNodesWithNameUsingBlock, focusBehavior, focusGroupIdentifier, focusItemContainer, frame, hasActions, inParentHierarchy, insertChildAtIndex, intersectsNode, isEqualToNode, isHidden, isPaused, isUserInteractionEnabled, moveToParent, name, nodeAtPoint, nodesAtPoint, objectForKeyedSubscript, parent, parentFocusEnvironment, physicsBody, position, preferredFocusedView, preferredFocusEnvironments, reachConstraints, removeActionForKey, removeAllActions, removeAllChildren, removeChildrenInArray, removeFromParent, runAction, runActionCompletion, runActionWithKey, scene, setAlpha, setAttributeValues, setConstraints, setEntity, setEntity_unsafe, setFocusBehavior, setHidden, setName, setNeedsFocusUpdate, setPaused, setPhysicsBody, setPosition, setReachConstraints, setScale, setSpeed, setUserData, setUserInteractionEnabled, setValueForAttributeNamed, setXScale, setYScale, setZPosition, setZRotation, shouldUpdateFocusInContext, speed, updateFocusIfNeeded, userData, valueForAttributeNamed, xScale, yScale, zPosition, zRotation
-
Methods inherited from class apple.uikit.UIResponder
activityItemsConfiguration, becomeFirstResponder, buildMenuWithBuilder, canBecomeFirstResponder, canPasteItemProviders, canPerformActionWithSender, canResignFirstResponder, copy, cut, decreaseSize, delete, editingInteractionConfiguration, increaseSize, inputAccessoryView, inputAccessoryViewController, inputAssistantItem, inputView, inputViewController, isFirstResponder, keyCommands, makeTextWritingDirectionLeftToRight, makeTextWritingDirectionRightToLeft, motionBeganWithEvent, motionCancelledWithEvent, motionEndedWithEvent, nextResponder, paste, pasteConfiguration, pasteItemProviders, pressesBeganWithEvent, pressesCancelledWithEvent, pressesChangedWithEvent, pressesEndedWithEvent, reloadInputViews, remoteControlReceivedWithEvent, resignFirstResponder, restoreUserActivityState, select, selectAll, setActivityItemsConfiguration, setPasteConfiguration, setUserActivity, targetForActionWithSender, textInputContextIdentifier, textInputMode, toggleBoldface, toggleItalics, toggleUnderline, touchesBeganWithEvent, touchesCancelledWithEvent, touchesEndedWithEvent, touchesEstimatedPropertiesUpdated, touchesMovedWithEvent, undoManager, updateTextAttributesWithConversionHandler, updateUserActivityState, userActivity, validateCommand
-
Methods inherited from class apple.NSObject
accessibilityActivate, accessibilityActivationPoint, accessibilityAssistiveTechnologyFocusedIdentifiers, accessibilityAttributedHint, accessibilityAttributedLabel, accessibilityAttributedUserInputLabels, accessibilityAttributedValue, accessibilityContainerType, accessibilityCustomActions, accessibilityCustomRotors, accessibilityDecrement, accessibilityDragSourceDescriptors, accessibilityDropPointDescriptors, accessibilityElementAtIndex, accessibilityElementCount, accessibilityElementDidBecomeFocused, accessibilityElementDidLoseFocus, accessibilityElementIsFocused, accessibilityElements, accessibilityElementsHidden, accessibilityFrame, accessibilityHint, accessibilityIncrement, accessibilityLabel, accessibilityLanguage, accessibilityNavigationStyle, accessibilityPath, accessibilityPerformEscape, accessibilityPerformMagicTap, accessibilityRespondsToUserInteraction, accessibilityScroll, accessibilityTextualContext, accessibilityTraits, accessibilityUserInputLabels, accessibilityValue, accessibilityViewIsModal, addObserverForKeyPathOptionsContext, attemptRecoveryFromErrorOptionIndex, attemptRecoveryFromErrorOptionIndexDelegateDidRecoverSelectorContextInfo, autoContentAccessingProxy, awakeAfterUsingCoder, awakeFromNib, class_objc, classForCoder, classForKeyedArchiver, copy, dealloc, debugDescription, description, dictionaryWithValuesForKeys, didChangeValueForKey, didChangeValueForKeyWithSetMutationUsingObjects, didChangeValuesAtIndexesForKey, doesNotRecognizeSelector, fileManagerShouldProceedAfterError, fileManagerWillProcessPath, finalize_objc, forwardingTargetForSelector, forwardInvocation, hash, indexOfAccessibilityElement, isAccessibilityElement, isEqual, isKindOfClass, isMemberOfClass, isProxy, methodForSelector, methodSignatureForSelector, mutableArrayValueForKey, mutableArrayValueForKeyPath, mutableCopy, mutableOrderedSetValueForKey, mutableOrderedSetValueForKeyPath, mutableSetValueForKey, mutableSetValueForKeyPath, observationInfo, observeValueForKeyPathOfObjectChangeContext, performSelector, performSelectorInBackgroundWithObject, performSelectorOnMainThreadWithObjectWaitUntilDone, performSelectorOnMainThreadWithObjectWaitUntilDoneModes, performSelectorOnThreadWithObjectWaitUntilDone, performSelectorOnThreadWithObjectWaitUntilDoneModes, performSelectorWithObject, performSelectorWithObjectAfterDelay, performSelectorWithObjectAfterDelayInModes, performSelectorWithObjectWithObject, prepareForInterfaceBuilder, provideImageDataBytesPerRowOrigin_Size_UserInfo, removeObserverForKeyPath, removeObserverForKeyPathContext, replacementObjectForCoder, replacementObjectForKeyedArchiver, respondsToSelector, self, setAccessibilityActivationPoint, setAccessibilityAttributedHint, setAccessibilityAttributedLabel, setAccessibilityAttributedUserInputLabels, setAccessibilityAttributedValue, setAccessibilityContainerType, setAccessibilityCustomActions, setAccessibilityCustomRotors, setAccessibilityDragSourceDescriptors, setAccessibilityDropPointDescriptors, setAccessibilityElements, setAccessibilityElementsHidden, setAccessibilityFrame, setAccessibilityHint, setAccessibilityLabel, setAccessibilityLanguage, setAccessibilityNavigationStyle, setAccessibilityPath, setAccessibilityRespondsToUserInteraction, setAccessibilityTextualContext, setAccessibilityTraits, setAccessibilityUserInputLabels, setAccessibilityValue, setAccessibilityViewIsModal, setIsAccessibilityElement, setNilValueForKey, setObservationInfo, setShouldGroupAccessibilityChildren, setValueForKey, setValueForKeyPath, setValueForUndefinedKey, setValuesForKeysWithDictionary, shouldGroupAccessibilityChildren, superclass, validateValueForKeyError, validateValueForKeyPathError, valueForKey, valueForKeyPath, valueForUndefinedKey, willChangeValueForKey, willChangeValueForKeyWithSetMutationUsingObjects, willChangeValuesAtIndexesForKey
-
-
-
-
Method Detail
-
accessInstanceVariablesDirectly
public static boolean accessInstanceVariablesDirectly()
-
alloc
public static SKFieldNode alloc()
-
allocWithZone
public static java.lang.Object allocWithZone(org.moe.natj.general.ptr.VoidPtr zone)
-
automaticallyNotifiesObserversForKey
public static boolean automaticallyNotifiesObserversForKey(java.lang.String key)
-
cancelPreviousPerformRequestsWithTarget
public static void cancelPreviousPerformRequestsWithTarget(java.lang.Object aTarget)
-
cancelPreviousPerformRequestsWithTargetSelectorObject
public static void cancelPreviousPerformRequestsWithTargetSelectorObject(java.lang.Object aTarget, org.moe.natj.objc.SEL aSelector, java.lang.Object anArgument)
-
classFallbacksForKeyedArchiver
public static NSArray<java.lang.String> classFallbacksForKeyedArchiver()
-
classForKeyedUnarchiver
public static org.moe.natj.objc.Class classForKeyedUnarchiver()
-
clearTextInputContextIdentifier
public static void clearTextInputContextIdentifier(java.lang.String identifier)
-
debugDescription_static
public static java.lang.String debugDescription_static()
-
description_static
public static java.lang.String description_static()
-
dragField
public static SKFieldNode dragField()
Slows an object proportionally to the object’s velocity. Use this to simulate effects such as friction from motion through the air.
-
electricField
public static SKFieldNode electricField()
A force proportional to the charge on the object. A charge property has been added to SKPhysicsBodies to accomplish this. An example use of this field is to make objects behavior differently from one another when they enter a region, or to make an object's behavior different than its mass based behavior This field models the first part of the Lorentz equation, F = qE
-
hash_static
public static long hash_static()
-
instanceMethodForSelector
public static NSObject.Function_instanceMethodForSelector_ret instanceMethodForSelector(org.moe.natj.objc.SEL aSelector)
-
instanceMethodSignatureForSelector
public static NSMethodSignature instanceMethodSignatureForSelector(org.moe.natj.objc.SEL aSelector)
-
instancesRespondToSelector
public static boolean instancesRespondToSelector(org.moe.natj.objc.SEL aSelector)
-
isSubclassOfClass
public static boolean isSubclassOfClass(org.moe.natj.objc.Class aClass)
-
keyPathsForValuesAffectingValueForKey
public static NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey(java.lang.String key)
-
magneticField
public static SKFieldNode magneticField()
A force proportional to the charge on the object and the object’s velocity. A charge property has been added to SKPhysicsBodies to accomplish this. An example use of this field is to make objects behavior differently from one another when they enter a region, or to make an object's behavior different than its mass based behavior This field models the second part of the Lorentz equation, F = qvB
-
new_objc
public static java.lang.Object new_objc()
-
node
public static SKFieldNode node()
-
nodeWithFileNamed
public static SKFieldNode nodeWithFileNamed(java.lang.String filename)
-
noiseFieldWithSmoothnessAnimationSpeed
public static SKFieldNode noiseFieldWithSmoothnessAnimationSpeed(double smoothness, double speed)
A time varying differentiable Perlin simplex noise field. By default a smooth noise is calculated, and the field is time varying. Use this to simulate such effects as fireflies, or snow. To freeze the noise in place, set animationSpeed to 0.0. Mass is ignored.- Parameters:
smoothness- value of 0 means as noisy as possible, 1 means as smooth as possiblespeed- is the general rate in Hz that any particular texel changes to a different value- See Also:
smoothness(),animationSpeed()
-
obstaclesFromNodeBounds
public static NSArray<? extends GKPolygonObstacle> obstaclesFromNodeBounds(NSArray<? extends SKNode> nodes)
-
obstaclesFromNodePhysicsBodies
public static NSArray<? extends GKPolygonObstacle> obstaclesFromNodePhysicsBodies(NSArray<? extends SKNode> nodes)
-
obstaclesFromSpriteTexturesAccuracy
public static NSArray<? extends GKPolygonObstacle> obstaclesFromSpriteTexturesAccuracy(NSArray<? extends SKNode> sprites, float accuracy)
-
radialGravityField
public static SKFieldNode radialGravityField()
Applies a force in the direction of the origin of the field in local space. To repel objects, use a negative strength. The force is proportional to the distance from the field origin. Varies with the mass of the object according to F = ma The field node's rotation property can be used to orient the gravity in a particular direction.
-
resolveClassMethod
public static boolean resolveClassMethod(org.moe.natj.objc.SEL sel)
-
resolveInstanceMethod
public static boolean resolveInstanceMethod(org.moe.natj.objc.SEL sel)
-
setVersion_static
public static void setVersion_static(long aVersion)
-
springField
public static SKFieldNode springField()
A Hooke’s law force - a force linearly proportional to distance from the center of the field. An object in this field will oscillate with a period proportional to the inverse of the mass. An example use is to keep objects confined to a particular region.
-
superclass_static
public static org.moe.natj.objc.Class superclass_static()
-
turbulenceFieldWithSmoothnessAnimationSpeed
public static SKFieldNode turbulenceFieldWithSmoothnessAnimationSpeed(double smoothness, double speed)
Just like Noise, except the strength of the noise is proportional to the velocity of the object in the field.- Parameters:
smoothness- value of 0 means as noisy as possible, 1 means as smooth as possiblespeed- is the general rate in Hz that any particular texel changes to a different value- See Also:
smoothness(),animationSpeed()
-
velocityFieldWithTexture
public static SKFieldNode velocityFieldWithTexture(SKTexture velocityTexture)
The supplied texture contains velocity values for any object entering the field’s area of effect. If no texture is supplied, the direction property is used instead. Velocity fields override the effect of any other acceleration applied to the body. Velocity fields are typically used for such effects as advection, for example, a velocity field might describe the velocity on the surface of a river. An object placed in the river would then follow the river.- Parameters:
velocityTexture- The R and G channels of the supplied texture become x and y components of velocity. B and A, if present in the SKTexture, are ignored.- See Also:
texture()
-
version_static
public static long version_static()
-
vortexField
public static SKFieldNode vortexField()
Applies a force tangential to the direction from the sample point to the field's position. The force will be CCW to the direction. Make the strength negative to apply force in the CW direction. Amount is proportional to distance from center and the object's mass. Use this to create effects such as tornadoes.
-
animationSpeed
public float animationSpeed()
fields that can be animated can have non zero values. A value of 2 will animated twice as fast as a value of 1.
-
categoryBitMask
public int categoryBitMask()
Logical categories the field belongs to. Default is all categories. These categories correspond to fieldBitMasks, and can be used to enforce that a particular field applies to a particular category of objects.- See Also:
SKPhysicsBody.fieldBitMask,SKEmitterNode.fieldBitMask
-
falloff
public float falloff()
The falloff exponent used to calculate field strength at a distance. Falloff starts at the minimum radius. The default exponent is zero, which results in a uniform field with no falloff.- See Also:
minimumRadius()
-
init
public SKFieldNode init()
-
initWithCoder
public SKFieldNode initWithCoder(NSCoder aDecoder)
Description copied from interface:NSCodingNS_DESIGNATED_INITIALIZER- Specified by:
initWithCoderin interfaceNSCoding- Overrides:
initWithCoderin classSKNode
-
isEnabled
public boolean isEnabled()
If enabled, a field has an effect. default YES
-
setEnabled
public void setEnabled(boolean value)
If enabled, a field has an effect. default YES
-
isExclusive
public boolean isExclusive()
If a field is exclusive, it suppresses any other field in its region of effect. If two or more exclusive fields overlap, it is undefined which one of them will take effect- See Also:
region()
-
setExclusive
public void setExclusive(boolean value)
If a field is exclusive, it suppresses any other field in its region of effect. If two or more exclusive fields overlap, it is undefined which one of them will take effect- See Also:
region()
-
minimumRadius
public float minimumRadius()
minimum radius of effect. Default is very small.
-
region
public SKRegion region()
The region property is the domain of the field's effect. No force is applied to objects outside the region.
-
setAnimationSpeed
public void setAnimationSpeed(float value)
fields that can be animated can have non zero values. A value of 2 will animated twice as fast as a value of 1.
-
setCategoryBitMask
public void setCategoryBitMask(int value)
Logical categories the field belongs to. Default is all categories. These categories correspond to fieldBitMasks, and can be used to enforce that a particular field applies to a particular category of objects.- See Also:
SKPhysicsBody.fieldBitMask,SKEmitterNode.fieldBitMask
-
setFalloff
public void setFalloff(float value)
The falloff exponent used to calculate field strength at a distance. Falloff starts at the minimum radius. The default exponent is zero, which results in a uniform field with no falloff.- See Also:
minimumRadius()
-
setMinimumRadius
public void setMinimumRadius(float value)
minimum radius of effect. Default is very small.
-
setRegion
public void setRegion(SKRegion value)
The region property is the domain of the field's effect. No force is applied to objects outside the region.
-
setSmoothness
public void setSmoothness(float value)
fields without a smoothness component will return 0
-
setStrength
public void setStrength(float value)
strength scaling value. default 1.0
-
setTexture
public void setTexture(SKTexture value)
fields constructed with a texture can be uppdated by assigning a new texture
-
smoothness
public float smoothness()
fields without a smoothness component will return 0
-
strength
public float strength()
strength scaling value. default 1.0
-
texture
public SKTexture texture()
fields constructed with a texture can be uppdated by assigning a new texture
-
nodeWithFileNamedSecurelyWithClassesAndError
public static SKFieldNode nodeWithFileNamedSecurelyWithClassesAndError(java.lang.String filename, NSSet<? extends org.moe.natj.objc.Class> classes, org.moe.natj.general.ptr.Ptr<NSError> error)
-
supportsSecureCoding
public static boolean supportsSecureCoding()
-
_supportsSecureCoding
public boolean _supportsSecureCoding()
Description copied from interface:NSSecureCodingThis property must return YES on all classes that allow secure coding. Subclasses of classes that adopt NSSecureCoding and override initWithCoder: must also override this method and return YES. The Secure Coding Guide should be consulted when writing methods that decode data.- Specified by:
_supportsSecureCodingin interfaceNSSecureCoding- Overrides:
_supportsSecureCodingin classSKNode
-
-