mirror of https://github.com/axmolengine/axmol.git
Move getWorldPosition() from Widget to Node class (#978)
* Committing genbindings changes * Move getWorldPosition() method to Node class to allow world position to be retrieved for any node.
This commit is contained in:
parent
23b19d4b40
commit
1a0612ca6e
|
@ -1929,6 +1929,11 @@ Vec2 Node::convertTouchToNodeSpaceAR(Touch* touch) const
|
|||
return this->convertToNodeSpaceAR(point);
|
||||
}
|
||||
|
||||
Vec2 Node::getWorldPosition() const
|
||||
{
|
||||
return convertToWorldSpace(Vec2(_anchorPoint.x * _contentSize.width, _anchorPoint.y * _contentSize.height));
|
||||
}
|
||||
|
||||
void Node::updateTransform()
|
||||
{
|
||||
// Recursively iterate over children
|
||||
|
|
|
@ -1608,6 +1608,13 @@ public:
|
|||
*/
|
||||
Vec2 convertTouchToNodeSpaceAR(Touch* touch) const;
|
||||
|
||||
/**
|
||||
* Gets position of widget in world space.
|
||||
*
|
||||
* @return Position of widget in world space.
|
||||
*/
|
||||
Vec2 getWorldPosition() const;
|
||||
|
||||
/**
|
||||
* Sets an additional transform matrix to the node.
|
||||
*
|
||||
|
|
|
@ -503,11 +503,6 @@ const Vec2& Widget::getSizePercent()
|
|||
return _sizePercent;
|
||||
}
|
||||
|
||||
Vec2 Widget::getWorldPosition() const
|
||||
{
|
||||
return convertToWorldSpace(Vec2(_anchorPoint.x * _contentSize.width, _anchorPoint.y * _contentSize.height));
|
||||
}
|
||||
|
||||
Node* Widget::getVirtualRenderer()
|
||||
{
|
||||
return this;
|
||||
|
|
|
@ -511,13 +511,6 @@ public:
|
|||
*/
|
||||
bool isIgnoreContentAdaptWithSize() const;
|
||||
|
||||
/**
|
||||
* Gets position of widget in world space.
|
||||
*
|
||||
* @return Position of widget in world space.
|
||||
*/
|
||||
Vec2 getWorldPosition() const;
|
||||
|
||||
/**
|
||||
* Gets the inner Renderer node of widget.
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue