Not a begginner as such, but this is a begginner type question that is really confusing me.
Right, I have written a basic Bitmap Font function.
Its nothing special, it just reads in the text and then draws the frame of the animimage bitmap font to the screen based on the Ascii code of each letter....just your basic bitmap font function.
Now for the strange bit.
In my function I am allowed to pass a few things -
Function BMP_Text(text$,posx,posy,fontnumber)
Now text$ is obviously the string you want to display.
posx and posy are the starting locations (it can also do things like right/left/centre justify but I am keeping the example simple)
The problem is fontnumber
the idea is that I load 3 or 4 bitmaps (as animimages) for each style of font I am using. This is done at the beginning of the code and because they are only small files it doesn't have any hit on the code itself.
Now I call each BMPFont1, BMPFont2, BMPFont3 etc
The idea is that in the drawimage code I put
usedimage$ = "BMPFont" + Fontnumber
For count = 1 to len(text$)
letter$ = mid$(Text$,count,1)
Drawimage usedimage$,100,100,asc(letter$)
Next
Again the example above is simplified (each letter will overwrite the last in that code I realise)
However I get an error saying Image not found, even tho on the debug I can clearly see that usedimage$ is set to BMPFont1 of whatever.
How do I pass the name of the image I want to use into my proc?
I have tried making usedimage$ global, the Loadanimimage is global etc etc but I can't work it out.
I will try and post the 'real' code later tonight, all the stuff above is just off the top of my head whilst in work and thinking about it :)
Cheers,
Mark
Right, I have written a basic Bitmap Font function.
Its nothing special, it just reads in the text and then draws the frame of the animimage bitmap font to the screen based on the Ascii code of each letter....just your basic bitmap font function.
Now for the strange bit.
In my function I am allowed to pass a few things -
Function BMP_Text(text$,posx,posy,fontnumber)
Now text$ is obviously the string you want to display.
posx and posy are the starting locations (it can also do things like right/left/centre justify but I am keeping the example simple)
The problem is fontnumber
the idea is that I load 3 or 4 bitmaps (as animimages) for each style of font I am using. This is done at the beginning of the code and because they are only small files it doesn't have any hit on the code itself.
Now I call each BMPFont1, BMPFont2, BMPFont3 etc
The idea is that in the drawimage code I put
usedimage$ = "BMPFont" + Fontnumber
For count = 1 to len(text$)
letter$ = mid$(Text$,count,1)
Drawimage usedimage$,100,100,asc(letter$)
Next
Again the example above is simplified (each letter will overwrite the last in that code I realise)
However I get an error saying Image not found, even tho on the debug I can clearly see that usedimage$ is set to BMPFont1 of whatever.
How do I pass the name of the image I want to use into my proc?
I have tried making usedimage$ global, the Loadanimimage is global etc etc but I can't work it out.
I will try and post the 'real' code later tonight, all the stuff above is just off the top of my head whilst in work and thinking about it :)
Cheers,
Mark