display % in textbox

msmalik681

OpenBOR Developer
Staff member
I am having trouble displaying the % sign in textbox I know it works on drawstring but nothing is displayed with textbox.


I will show if I use escape character "\%" but then the percentage sign is distorted and the escape character is also displaying can anyone help.
 
settextobj(13, 200, 90, 1, 999999994, "ATK: " + atk + "%");


the above code shows nothing where the percentage icon should be !


settextobj(13, 200, 90, 1, 999999994, " %ATK: " + atk );


Tried this as a test and i got some garbage output replacing ATK !
 
msmalik681 said:

That just means you don't have a % in your fonts, or if you do it's in the wrong spot. Like any other application, OpenBOR can't display a character it doesn't have. You need to add the % sign into your fonts. Here's the full tutorial on fonts in case you need it.

DC
 
my fonts % sign is in the right place I tested with settextobj to display all characters in that line they all display besides the % sign but I also tested with drawstring and the % sign displayed just fine.


I thought it might have something to do with commands like %d but maybe I am overthinking it.





[attachment deleted by admin]
 
you are right. It's an openbor bug!
Fixed! Check build 4430  ;)

However with openbor bugged you need to write:
settextobj(13, 200, 90, 1, 999999994, "ATK: " + atk + "%%");
from 4430 simply:
settextobj(13, 200, 90, 1, 999999994, "ATK: " + atk + "%");

Enjoy!
 
Back
Top Bottom