cocos3d  2.0.0
Instance Methods | Properties | List of all members
CCNode(CC3) Category Reference

#import <CC3CC2Extensions.h>

Instance Methods

(BOOL) - cc3ContainsTouchPoint:
 
(CGPoint) - cc3ConvertNodePointToUISpace:
 
(CGPoint) - cc3ConvertNSEventToNodeSpace:
 
(CGPoint) - cc3ConvertUIMovementToNodeSpace:
 
(CGPoint) - cc3ConvertUIPointToNodeSpace:
 
(CGPoint) - cc3NormalizeUIMovement:
 
(BOOL) - cc3WillConsumeTouchEventAt:
 
(void) - reshapeProjection:
 
(void) - updateViewport
 

Properties

CGRect globalBoundingBoxInPixels
 
BOOL touchEnabled
 

Detailed Description

Extension category to support cocos3d functionality.

Method Documentation

- (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) reshapeProjection: (CGSize)  newWindowSize

Invoked automatically when the window has been resized while running in OSX.

This implementation simply propagates the same method to the children. Subclasses may override to actually do something when the window resizes.

- (void) updateViewport

Updates the viewport of any contained CC3Scene instances with the dimensions of its CC3Layer and the device orientation.

This CCNode implementation simply passes the notification along to its children. Descendants that are CC3Layers will update their CC3Scene instances.

Property Documentation

- (CGRect) globalBoundingBoxInPixels
readnonatomicassign

Returns the bounding box of this CCNode, measured in pixels, in the global coordinate system.

- (BOOL) touchEnabled
readnonatomicassign

Returns whether this node will receive touch events.

This implementation returns NO.


The documentation for this category was generated from the following file: