hushaojie04 / libgdx

Automatically exported from code.google.com/p/libgdx
0 stars 0 forks source link

BitmapFont object fails with no parameters on iOS #1100

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Now, for all that I know I could be setting up my MonoDevelop project wrong, so 
if I am you can simply close this issue (I would appreciate a pointer as to 
what I did wrong, however).

I am using a BitmapFont object with no parameters to render FPS values, and 
when I run my iOS project (using gdx-backend-iosmonotouch) the program crashes 
when the constructor is called.  If I omit the constructor, the program runs as 
usual.
I believe this is because of a reference to the default font file which is not 
copied into the iOS binary.
It is not a show-stopping bug, however it is likely to cause some unexpected 
crashes when people are porting their games to iOS and should likely be fixed 
before a more public release.

Original issue reported on code.google.com by layze...@redrasor.com on 24 Oct 2012 at 4:03

GoogleCodeExporter commented 9 years ago
The problem is that we can't load classpath images for default BitmapFont yet 
because they are not exported in the dll after ikvm converts your classes, and 
I believe it won't be supported for now. You have to add default font assets 
(arial-15.fnt and arial-15.png) and reference them in your monotouch project 
and change your code to always load a BitmapFont using them instead of using 
the default constructor.

Remember to take a look at http://code.google.com/p/libgdx/wiki/IOSWIP which 
has some information of what stuff that works and stuff that doesn't (I believe 
we have to add something about the fonts).

Original comment by ariel.co...@gmail.com on 24 Oct 2012 at 12:16

GoogleCodeExporter commented 9 years ago
It sounds like it will work once you have the assets in the iOS project. Is 
this true/can we close the issue?

Original comment by nathan.s...@gmail.com on 27 Oct 2012 at 3:32

GoogleCodeExporter commented 9 years ago
I am not sure what to do, there is a workaround so we can reduce its priority, 
but don't know if, in the end, the idea is to support classpath resources in 
iOS or not.

Original comment by ariel.co...@gmail.com on 27 Oct 2012 at 4:08

GoogleCodeExporter commented 9 years ago
We can't support classpath resources on iOS. This default constructor will thus 
stay problematic. Closing this.

Original comment by badlogicgames on 29 Dec 2012 at 11:19