Maybe I am just doing something wrong but I am trying to get the Y value when I tap the device and the X value gets returned correctly but the Y value is not correct. For instance when I click near the top left corner of the screen (0,0) the X gets returned correctly and is close to 0 but the the Y value is in the -60's.
m_touchID = agk::GetRawFirstTouchEvent();
if(agk::GetPointerPressed() == 1 )
{
m_pointerX = agk::GetPointerX();
m_pointerY = agk::GetPointerY();
}
if(agk::GetRawTouchReleased(m_touchID))
{
m_lastPointerX = agk::GetPointerX();
m_lastPointerY = agk::GetPointerY();
if(agk::GetRawTouchType(m_touchID) == 3)
{
if(agk::SpriteRayCast(m_pointerX,m_pointerY,m_lastPointerX,m_lastPointerY) == 1 && agk::GetRayCastSpriteID() == m_spriteID)
{
if(m_bCanToss)
{
Toss();
}
}
}
else if (agk::GetRawTouchType(m_touchID) == 1)
{
if(agk::GetSpriteHitTest(m_spriteID,m_pointerX,m_pointerY) == 1)
{
m_health - 10;
}
}
}
Why is the Y value returning a negative number?
EDIT:
Never mind