Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / GetTextTotalWidth() doesn't seem to work properly...

Author
Message
=PRoF=
21
Years of Service
User Offline
Joined: 17th Mar 2003
Location: Milton Keynes, UK
Posted: 15th Dec 2014 14:20
I'm having problems with GetTextTotalWidth() using a custom bitmap font.

It's reporting the size of a line of 15 "i"'s ,which takes up approximately half the screen; as the same size as a line of "w"'s which is an entire screen width.

Quote: "This does not take into account the individual offsets of characters, if you have used SetTextCharX or similar to move a character."


Needless to say, although I have altered the spacing of the text itself, I have not altered any individual offsets.

This is using AppGameKit v2.0.10

Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 15th Dec 2014 17:36
This works for me
=PRoF=
21
Years of Service
User Offline
Joined: 17th Mar 2003
Location: Milton Keynes, UK
Posted: 16th Dec 2014 00:10 Edited at: 16th Dec 2014 00:19
Hmm, It works for me as well; even when I use the font I'm using in the project where it's not working.

The problem must lay elsewhere, probably something silly in my code. Thanks for looking anyway

>Edit<
It was indeed something silly in my code. It turns out I wasn't assigning the font image ID properly to the dummy text which I was using to determine width, so it was just using the default fixed width font. *facepalm*

Login to post a reply

Server time is: 2024-11-25 13:25:03
Your offset time is: 2024-11-25 13:25:03