Font Texture Issue (5 weeks)

  ... discussions about development with the GLES1 branch of AndEngine.

Font Texture Issue (5 weeks)

Postby wickedbear » Thu May 03, 2012 12:02 am

Hi Everyone,

I've been stuck on this issue for 5 weeks, so forgive me if I come off a bit frustrated :)

I recently converted my game to a multi-scene loading process. I ran into several issues with that and thanks to help with FishFPG in particular ive worked through alot of possible solutions. The first issue I was having is the scene loading was completing before textures were loaded to hardware and causing my game to crash. By putting in a validation on if the texture was loaded to hardware i was able to fix the image texture issues.

However, fonts, were different. After talking with fish he had stated that he could never get font textures to work properly with multi scenes. He suggested I load them at the start of the engine in on load resources, so I have done that and it does not work either.

Font's are just an issue for me, here are all the various symptoms i've had happen despite many attempts of trying things.
-Some text may not load
-All the text will not load, however, if i hit the home button to minimize the app and remaximize it, the fonts will all be there perfectly
-No possible way to check for font textures loaded to hardware. This validation seems completely worthless.

If anyone has any idea what I can do to approach this I would be greatful. My solution is far too big to post code but if the discussion needs it I will try to pick out some code snippits but I'm not doing anything crazy when it comes to the fonts in particular.
iRC Nick: Muramasa
wickedbear
 
Posts: 17
Joined: Tue Nov 16, 2010 4:04 am

Re: Font Texture Issue (5 weeks)

Postby ViktorS » Thu May 03, 2012 11:11 am

Yeah, fonts are a b*tch... always had one kind or another of problem with them... But not to this extereme... Well, if it's THAT bad... I can suggest a solution from ye olde Internet days. Back to the times when custom fonts were very bitchy. Solution goes as follows: Load and treat fonts as image. Type every letter and/or number and/or symbol in CAPS and/or plain text and/or Bold, Italic, etc... There ae several solutions from this point forward - I'd try this one first: Extend BaseSprite class and write your own "TextSprite" which will accept String and texture with font as parameters And compose the text from different parts of texture or something.

P.S. How many fonts do you actually need if it's gone this bad? I used up to 4 different fonts up to now, and even though there were some problems(artifacts mainly, at first) it was never THAT bad.
'Javelin OU' presents, my latest game - Joj the alien
ViktorS
 
Posts: 580
Joined: Thu Oct 27, 2011 2:18 pm

Re: Font Texture Issue (5 weeks)

Postby wickedbear » Thu May 03, 2012 8:45 pm

It's only 4 fonts currently, I just don't get why they wont work! I had no issues with them prior to multi scenes, but this is atrocious.

I think your idea is feasible. It sucks, but its feasible lol! I really don't want to do that if I can avoid it.
iRC Nick: Muramasa
wickedbear
 
Posts: 17
Joined: Tue Nov 16, 2010 4:04 am

Re: Font Texture Issue (5 weeks)

Postby wickedbear » Thu May 03, 2012 10:10 pm

are fonts tied to the scene in which they were implemented?
iRC Nick: Muramasa
wickedbear
 
Posts: 17
Joined: Tue Nov 16, 2010 4:04 am

Re: Font Texture Issue (5 weeks)

Postby wickedbear » Sun May 06, 2012 10:48 pm

I don't know if this will help anyone, but after 5 weeks if I can prevent anyone from going through what I did, its worth it.

If you are threading resource loading and using fonts in multiple scenes, the fix I did was this.

Create & Add to scene EVERY TIME -after- the loading thread is run.
iRC Nick: Muramasa
wickedbear
 
Posts: 17
Joined: Tue Nov 16, 2010 4:04 am


Return to GLES1

Who is online

Users browsing this forum: Google [Bot] and 23 guests