CCNode: add [set|get]Position[X|Y](void) back.

This commit is contained in:
walzer 2013-01-21 16:26:02 +08:00
parent c184567329
commit 996d2be2b6
2 changed files with 28 additions and 0 deletions

View File

@ -293,6 +293,26 @@ void CCNode::setPosition(float x, float y)
setPosition(ccp(x, y));
}
float CCNode::getPositionX(void)
{
return m_obPosition.x;
}
float CCNode::getPositionY(void)
{
return m_obPosition.y;
}
void CCNode::setPositionX(float x)
{
setPosition(ccp(x, m_obPosition.y));
}
void CCNode::setPositionY(float y)
{
setPosition(ccp(m_obPosition.x, y));
}
/// children getter
CCArray* CCNode::getChildren()
{

View File

@ -311,6 +311,14 @@ public:
* @see setPosition(float, float)
*/
void getPosition(float* x, float* y);
/**
* Gets/Sets x or y coordinate individually for position.
* These methods are used in Lua and Javascript Bindings
*/
void setPositionX(float x);
float getPositionX(void);
void setPositionY(float y);
float getPositionY(void);
/**