Skip to content

Instantly share code, notes, and snippets.

@Tokuriku Tokuriku/Remap Point
Last active Aug 29, 2015

Embed
What would you like to do?
Remapping a CGPoint for use with SKPhysicsJoints in a non CGPointZero anchorPoint Scene
//To be applied to the anchor point
func remapPoint(point: CGPoint) -> CGPoint {
let correctedX = point.x + self.size.width * self.anchorPoint.x
let correctedY = point.y + self.size.height * self.anchorPoint.y
return CGPoint(x: correctedX, y: correctedY)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.