#import <CC3CC2Extensions.h>
Instance Methods | |
(CCScene *) | - asCCScene |
(BOOL) | - cc3ContainsTouchPoint: |
(CGPoint) | - cc3ConvertNodePointToUISpace: |
(CGPoint) | - cc3ConvertNSEventToNodeSpace: |
(CGPoint) | - cc3ConvertUIMovementToNodeSpace: |
(CGPoint) | - cc3ConvertUIPointToNodeSpace: |
(CGPoint) | - cc3NormalizeUIMovement: |
(BOOL) | - cc3WillConsumeTouchEventAt: |
(void) | - scheduleUpdate |
(void) | - updateViewport |
(void) | - viewDidResizeTo: |
(void) | - visit:parentTransform: |
Properties | |
CGRect | boundingBoxInPixels |
CGSize | contentSizeInPixels |
CGRect | globalBoundingBoxInPixels |
BOOL | ignoreAnchorPointForPosition |
BOOL | mouseEnabled |
NSInteger | mousePriority |
BOOL | touchEnabled |
Extension category to support Cocos3D functionality.
- (CCScene*) asCCScene |
Convenience method that wraps this node in a CCScene instance, and returns the CCScene instance.
This node will be held as a child node of the returned CCScene instance.
- (BOOL) cc3ContainsTouchPoint: | (CGPoint) | viewPoint |
Returns whether this node contains the specified UI touch location.
- (CGPoint) cc3ConvertNodePointToUISpace: | (CGPoint) | glPoint |
Returns a point in the coordinate space of the UIView that corresponds to the specified point in the coordinate space of this node, taking into consideration the orientation of the device.
This method performs the inverse of the operation provided by the cc3ConvertUIPointToNodeSpace: method.
- (CGPoint) cc3ConvertNSEventToNodeSpace: | (NSEvent *) | event |
Converts an NSEvent (typically a mouse event) to the local coordinates of this node.
- (CGPoint) cc3ConvertUIMovementToNodeSpace: | (CGPoint) | uiMovement |
Returns a movement in the coordinate space of this layer that corresponds to the specified movement in the coordinate space of the UIView, taking into consideration the orientation of the device.
You can use this method to convert movements in a UIView, including those returned by touch events and gestures, such as the translationInView: and velocityInView: methods of UIPanGestureRecognizer, to movement in this layer.
- (CGPoint) cc3ConvertUIPointToNodeSpace: | (CGPoint) | viewPoint |
Returns a point in the coordinate space of this node that corresponds to the specified point in the coordinate space of the UIView, taking into consideration the orientation of the device.
You can use this method to convert locations in a UIView, including those returned by touch events and gestures, such as the locationInView: method on tap and long-press gestures, to a location in this layer.
- (CGPoint) cc3NormalizeUIMovement: | (CGPoint) | uiMovement |
Normalizes the specified movement, which is in the coordinate space of the UIView, so that the movement is made relative to the size of this node.
The returned value is a fraction proportional to the size of this node. A drag movement from one side of the node all the way to the other side would return positive or negative one in the X or Y component of the returned point. Similarly, a drag movement from the center to one side would return 0.5 in the X or Y component of the returned point.
This method allows you to convert drag movements to a measurement that is independent of the absolute size of the node, and is of a scale useful for processing as input that is not used as a direct positioning value.
You can use this method to normalize movements in a UIView, including those returned by touch events and gestures, such as the translationInView: and velocityInView: methods of UIPanGestureRecognizer, so that they are proportional, and independent of, the size of this node.
This method takes into consideration the orientation of the device.
- (BOOL) cc3WillConsumeTouchEventAt: | (CGPoint) | viewPoint |
Returns whether this node, or any of its descendants will consume a touch event at the specified UIView location when presented with the event.
This method is useful for testing whether a touch event should be handled by a descendant node instead of a gesture recognizer. The result of this method can be used to cancel the gesture recognizer.
Based on Cocos2D Gesture Recognizer ideas by Krzysztof Zabłocki at: http://www.merowing.info/2012/03/using-gesturerecognizers-in-cocos2d/
- (void) scheduleUpdate |
For backwards compatibility with prior Cocos2D versions.
Does nothing.
- (void) updateViewport |
- (void) viewDidResizeTo: | (CGSize) | newViewSize |
Invoked automatically when the OS view has been resized.
This implementation simply propagates the same method to the children. Subclasses may override to actually do something when the view resizes.
- (void) visit: | (CCRenderer *) | renderer | |
parentTransform: | (const GLKMatrix4 *) | parentTransform | |
Backwards compatibility with Cocos2D 3.x renderer.
Simply invoks visit.
|
readnonatomicassign |
Cocos2D 2.x compatibility with pixel-based sizing.
|
readnonatomicassign |
Cocos2D 2.x compatibility with pixel-based sizing.
|
readnonatomicassign |
Returns the bounding box of this CCNode, measured in pixels, in the global coordinate system.
|
readwritenonatomicassign |
Use (0,0) when you position the CCNode.
Does nothing. Provided for backwards compatibility.
|
readwritenonatomicassign |
Returns whether this node will receive mouse events.
This implementation returns NO.
|
readwritenonatomicassign |
Dummy property for compatibility with prior Cocos2D versions.
Does nothing
|
readwritenonatomicassign |
Returns whether this node will receive touch events.
This implementation returns NO.