GLBasic forum

Main forum => GLBasic - en => Topic started by: MrTAToad on 2010-Mar-16

Title: Interesting Mac problem I had
Post by: MrTAToad on 2010-Mar-16
Recently had an interesting problem on a Mac - loading a sprite after loading a font, could corrupt the font (just get a grey box for each letter).  As far as I could tell, the sprite was overwriting the font graphic (obviously they share the same sprite index).

The way around it is to make sure each sprite uses a number generated by GENSPRITE()
Title: Re: Interesting Mac problem I had
Post by: Kitty Hello on 2010-Mar-16
can you verify what sprite/font ID you had that caused the overwrite?
Title: Re: Interesting Mac problem I had
Post by: MrTAToad on 2010-Mar-16
I will do - once I can get on my Mac :)
Title: Re: Interesting Mac problem I had
Post by: MrTAToad on 2010-Mar-16
Okay - using FONT 1, it becomes a mass of grey when loading in sprite 0

I use the following :

Code (glbasic) Select
SETFONT 1
PRINT "Loading sprite : "+l.idNumber%,100,100
SHOWSCREEN
KEYWAIT

LOADSPRITE file$,l.idNumber%

SETFONT 1
PRINT "here",100,100
SHOWSCREEN
KEYWAIT

Title: Re: Interesting Mac problem I had
Post by: Scott_AW on 2010-Mar-17
Why not distance your sprites from the font index, like maybe start sprite indexes at 10.  Never mind, reverse that.  Stick the font index at a higher number, like 255. 

Isn't loading a font treated like a animation, each character has an index?
Title: Re: Interesting Mac problem I had
Post by: MrTAToad on 2010-Mar-17
Its a bit of waste of indexes doing that unfortunately.