Projects > cpp > Issues > Bug #5506

We are migrating issue tracker of Cocos2d-x Project to Github, please create new issue there. Thanks.

Create Issue on Github

Director->convertToUI

Bug #5506 [Closed]
gorgo 2014-06-05 12:02 . Updated about 5 years ago

Hi!
I have made this test:

Vec2 v;
v.set(100.0, 200.0);
log("v %f, %f", v.x, v.y);
Vec2 gl = Director::getInstance()->convertToGL(v);
log("gl %f, %f", gl.x, gl.y);
Vec2 ui = Director::getInstance()->convertToUI(v);
log("ui %f, %f", ui.x, ui.y);
v = Director::getInstance()->convertToGL(Director::getInstance()->convertToUI(v));
log("v conv %f, %f", v.x, v.y);

and got result:
cocos2d: v 100.000000, 200.000000
cocos2d: gl 100.464775, 823.487610
cocos2d: ui -251470.062500, 277196.750000
cocos2d: v conv -251057.062500, -275719.031250

runs on Ios7.1 ipad simulator

It worked before, in 3.0 release, I guess. Then, after update to 3.1, it didn't. Use convertToUI to create fake Touch object.

zhangxm 2014-06-12 08:16
zhangxm 2014-06-12 08:19
  • Status changed from New to Resolved
  • Target version set to v3.2
zhangxm 2014-06-25 03:34
  • Status changed from Resolved to Closed

Atom PDF

Status:Closed
Start date:2014-06-05
Priority:Low
Due date:
Assignee:-
% Done:

0%

Category:ios
Target version:v3.2