Jump to content

Cocoonjs font issues


Binary Moon
 Share

Recommended Posts

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+ view
  • I'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

 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

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

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...