About Store Forum Documentation Contact



Post Reply 
ScreenToPos() problem
Author Message
McTomas Offline
Member

Post: #1
ScreenToPos() problem
Hi

Before the last engine update, the ScreenToPos() method worked in every part of the code. Now, with the last update, ScreenToPos() only works properly in the Draw() code part.

If I use ex: ScreenToPos(Vec2(0,-0.9)) in the Init() code part, it will always give me a zero Vec().

Ex:
Code:
Vec pos;
Bool Init()
{
    pos = ScreenToPos(Vec2(0,-0.9));
    return true;
}
void Shut()
{
}
/******************************************************************************/
Bool Update()
{
   return true;
}
void Draw()
{
    D.clear(BLACK);
    D.text(0,0,S+pos);
}

Probably I'm doing something wrong, but before the update my code was working fine.

Best Regards,

McTomas
(This post was last modified: 04-01-2010 02:09 AM by McTomas.)
04-01-2010 02:03 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #2
RE: ScreenToPos() problem
Hello,

Thanks for reporting the issue, I'll fix this for the next version.

In the meantime you can try calling
Code:
Bool Init()
{
   D.viewRect(NULL);

   here rest of the codes
04-01-2010 03:09 AM
Find all posts by this user Quote this message in a reply
McTomas Offline
Member

Post: #3
RE: ScreenToPos() problem
thank you grin
04-01-2010 03:09 PM
Find all posts by this user Quote this message in a reply
Post Reply