Archive for 'point'

The following code is used to check whether a point is inside a rectangle or not in cocos2d android. Consider a CCSprite object, mySprite

CGRect.containsPoint(mySprite.getBoundingBox(), CGPoint.ccp(30, 110)) // This will return true if the point (30, 110) is inside the sprite, mySprite and false otherwise.

Incoming search terms:

  • cocos2d-x check point in sprite
  • corona rectangle contains point
  • cocos2dx rect containspoint
  • cocos2d-x sprite contain point
  • check point is inside image in android
  • cocos2d test contains point
  • cocos2d sprite contain point
  • cocos2d point in rect
  • cocos2d check if point is in rectangle
  • mysprite is in rectangle cocos2d star

Converting GL Point to UITouch point in Cocos2D

It is possible to convert GL point to UITouch point in cocos2D using the following code :

Consider a GL point, glLocation.

// Now location will contain the UITouch point corresponding to GL point, glLocation.

Incoming search terms:

  • glpoint mac