Binary Moon Posted August 4, 2014 Share Posted August 4, 2014 I'm using a ttf font for my cocoonjs based game. Yesterday I created a custom launcher so I could test it on my phone (with the cocoonjs functionality). This is my first time using xcode so hopefully I did everything right. Either way - I have managed to compile the app on the cocoonjs site, sign it, then build it and get it onto my phone The problem is that now the fonts are way out of position (they're too high). I was under the impression this was fixed in the cocoonjs 2.0.2, phaser 2.0.7 combo - so I was hoping someone could help point me in the right direction for working out why it's not working. A few notes:I'm using canvas+ viewI'm not using multi line text (I know that still has issues)I'm using a ttf font (the new version of Roboto actually)I'm loading the game from a remote url on my website (should I switch to testing with a zip file?)I tried loading the game from a zip on the device but I get a black screen and no errors in the console (I guess this is a separate issue) Link to comment Share on other sites More sharing options...
Binary Moon Posted August 4, 2014 Author Share Posted August 4, 2014 I fixed the black screen issue. I needed to name my index file index.html and not index.htm So the font position is the only problem I have now (that and disappearing buttons - but I know that's a known problem) Link to comment Share on other sites More sharing options...
Videlais Posted August 5, 2014 Share Posted August 5, 2014 I saw your post in the Phaser + CocoonJS issues thread yesterday, and was going to reply today, but then saw this and thought it might be better to write comments here, instead. Yesterday I created a custom launcher so I could test it on my phone (with the cocoonjs functionality). This is my first time using xcode so hopefully I did everything right. While using a custom launcher can be pretty useful, I actually recommend getting the official launcher per platform too. That way, you have whatever the "official" release is (along with its updates) and can compare between versions. (For iOS, this isn't too much of a problem. However, on Android, with its different OS API versions, it can be useful to support older versions that the official release does not.) I'm loading the game from a remote url on my website (should I switch to testing with a zip file?) It's, of course, up to you, but I personally recommend ZIP files, yeah. It can be a little bit of a pain to move files on and off a device (iOS is easier than Android for that), but using ZIP files makes it easier to test multiple configurations quickly. You can load several ZIP files at once and run through them without having to re-type a URL. The problem is that now the fonts are way out of position (they're too high). Yeah, I've seen this recently too. I'm not exactly sure what the cause is yet, but my guess is that you are setting anchor values on the text somewhere. For some reason, that's not working right now and using anchor.set at all on text messes up its position by a great deal vertically. Link to comment Share on other sites More sharing options...
Binary Moon Posted August 5, 2014 Author Share Posted August 5, 2014 Thanks a lot for the feedback. The anchor thing sounds like it could be correct - I am setting the anchor to 0.5, 0.5 so that I can have easy centered text. I'll see if I can work out another way of centering the text Link to comment Share on other sites More sharing options...
valueerror Posted August 5, 2014 Share Posted August 5, 2014 infoText.x= game.world.centerX-infoText.width/2;that's my workaround for the anchor bug in cocoonjs Link to comment Share on other sites More sharing options...
Binary Moon Posted August 5, 2014 Author Share Posted August 5, 2014 Having experimented with it a bit more it seems the anchor.x position works fine. It's only the anchor.y position that is an issue. Thanks for pointing this out - it means my game is one step closer to being done ValueError - I used that for a while as well - but I am doing tweens on the text and it meant the pivot would be the corner rather than the middle which is why I experimented with the anchor values. Link to comment Share on other sites More sharing options...
Recommended Posts