mirror of https://github.com/axmolengine/axmol.git
migrate convertXXXX to Vector2
This commit is contained in:
parent
4df714b9d8
commit
633173005b
|
@ -1517,15 +1517,15 @@ Vector2 Node::convertToWorldSpace(const Vector2& nodePoint) const
|
|||
|
||||
}
|
||||
|
||||
Point Node::convertToNodeSpaceAR(const Point& worldPoint) const
|
||||
Vector2 Node::convertToNodeSpaceAR(const Vector2& worldPoint) const
|
||||
{
|
||||
Point nodePoint = convertToNodeSpace(worldPoint);
|
||||
Vector2 nodePoint = convertToNodeSpace(worldPoint);
|
||||
return nodePoint - _anchorPointInPoints;
|
||||
}
|
||||
|
||||
Point Node::convertToWorldSpaceAR(const Point& nodePoint) const
|
||||
Vector2 Node::convertToWorldSpaceAR(const Vector2& nodePoint) const
|
||||
{
|
||||
Point pt = nodePoint + _anchorPointInPoints;
|
||||
Vector2 pt = nodePoint + _anchorPointInPoints;
|
||||
return convertToWorldSpace(pt);
|
||||
}
|
||||
|
||||
|
@ -1536,12 +1536,13 @@ Point Node::convertToWindowSpace(const Point& nodePoint) const
|
|||
}
|
||||
|
||||
// convenience methods which take a Touch instead of Point
|
||||
Point Node::convertTouchToNodeSpace(Touch *touch) const
|
||||
Vector2 Node::convertTouchToNodeSpace(Touch *touch) const
|
||||
{
|
||||
Point point = touch->getLocation();
|
||||
return this->convertToNodeSpace(point);
|
||||
}
|
||||
Point Node::convertTouchToNodeSpaceAR(Touch *touch) const
|
||||
|
||||
Vector2 Node::convertTouchToNodeSpaceAR(Touch *touch) const
|
||||
{
|
||||
Point point = touch->getLocation();
|
||||
return this->convertToNodeSpaceAR(point);
|
||||
|
|
|
@ -1253,23 +1253,23 @@ public:
|
|||
* Converts a Point to node (local) space coordinates. The result is in Points.
|
||||
* treating the returned/received node point as anchor relative.
|
||||
*/
|
||||
Point convertToNodeSpaceAR(const Point& worldPoint) const;
|
||||
Vector2 convertToNodeSpaceAR(const Vector2& worldPoint) const;
|
||||
|
||||
/**
|
||||
* Converts a local Point to world space coordinates.The result is in Points.
|
||||
* treating the returned/received node point as anchor relative.
|
||||
*/
|
||||
Point convertToWorldSpaceAR(const Point& nodePoint) const;
|
||||
Vector2 convertToWorldSpaceAR(const Vector2& nodePoint) const;
|
||||
|
||||
/**
|
||||
* convenience methods which take a Touch instead of Point
|
||||
*/
|
||||
Point convertTouchToNodeSpace(Touch * touch) const;
|
||||
Vector2 convertTouchToNodeSpace(Touch * touch) const;
|
||||
|
||||
/**
|
||||
* converts a Touch (world coordinates) into a local coordinate. This method is AR (Anchor Relative).
|
||||
*/
|
||||
Point convertTouchToNodeSpaceAR(Touch * touch) const;
|
||||
Vector2 convertTouchToNodeSpaceAR(Touch * touch) const;
|
||||
|
||||
/**
|
||||
* Sets an additional transform matrix to the node.
|
||||
|
|
Loading…
Reference in New Issue