I have faced this issue more times than ever so not 100% sure what the reason for this is.
The Problem:
A project uses a True Type Font and is added to the project via add existing file. The when I hit run to test the project in the player, randomly it spawns an error
myTrueType.ttf: No such file or directory. |
while the font and everything else is in place. This in my opinion could be an error dues to memory leaks or something similar. In my project I am creating a lot of TTFont objects at different sizes.
This is a bit of a concern, so could you please let me know why this happens and how to fix that?
Comments
it is possible that ttf file handler is not properly closed and you run out of handlers and something like that.
Will get it to Atilim to check
http://docs.giderosmobile.com/reference/gideros/TTFont/new
Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
Cool Vizify Profile at https://www.vizify.com/oz-apps
BTW: The assets are encrypted if that would make a difference.
Using a newer version of GiderosSDK has fixed the black background issue, need to fix the rounding issue. @Atilim, would it be possible to round off these values in the functions rather than do that at the users end??
Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
Cool Vizify Profile at https://www.vizify.com/oz-apps
About rounding coordinates, well, there could be a problem, because theoretically, somone might want to set 100x100 logical dimensions and start positioning objects as setX(10.25) ,etc
As in, in my opinion it won't be good to intervene in the usage,
but as all positioning is inherited from Sprite, you can simply overwrite Sprite set/setX/setY/setPosition methods
1. TTF not found, irrespective of the version of Gideros, is still present and happens after a couple of runs
2. The Black background is because of the older/newer version exporting the app to xcode. When run in Gideros Player there was absolutely no issue.
The image above looks like it's been censored or information hidden, but that is what the exported project did.
I can override the functions, but the issue is not with the setX setY or setPosition, the problem is with the TTFont.new("fontname.ttf", fontSize) this fontSize has to be an integer, but when scaling for different resolutions, this will not be an integer all the times. So had to fix all the lines where a new font object is created. ALternatively I could also create a Font Object factory function that will fix this issue in one place only.
Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
Cool Vizify Profile at https://www.vizify.com/oz-apps
Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
Cool Vizify Profile at https://www.vizify.com/oz-apps
About overriding, my idea was:
Likes: OZApps
Here are some screenshots for the same.
Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
Cool Vizify Profile at https://www.vizify.com/oz-apps