Akis Posted February 9, 2014 Share Posted February 9, 2014 Hey all, I played a bit with the CocoonJS launcher today and in my 'game' and I noticed somethind weird with PIXI.Text. If I put an anchor on the text, I'll get my text with a wrong position. The X seems ok, but the issue is the Y. For exemple, in CocoonJS, if I want a text vertically aligned, I will need to put its position to the height of the canvas minus the demi height of the text. What?! It's not the job of the anchor do calculate that? Does anyone have seen this issue before? I don't have the issue with a sprite + anchor for exemple. I only have it with a Text. Quote Link to comment Share on other sites More sharing options...
Alvin Posted February 10, 2014 Share Posted February 10, 2014 Hi,I think it's because the text's height is measured using a DOM Element, which is not supported by cocoonJs, hence the fact you have to calculate it yourself. Quote Link to comment Share on other sites More sharing options...
xerver Posted February 10, 2014 Share Posted February 10, 2014 Alvin is correct, this is a known issue when working with CocoonJS, and one we are trying to fix for 1.6 Thanks for your patience! Quote Link to comment Share on other sites More sharing options...
Akis Posted February 10, 2014 Author Share Posted February 10, 2014 But I only get the issue if I use the anchor. If I set the text as 0,0 or 50,50 for exemple, the text appears at the right location.I can probably calculate myself the right position then. Thanks for the info! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.