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 / Tier 1 -- When rendering the text, some characters are missing

Author
Message
basicFanatic
7
Years of Service
User Offline
Joined: 7th Jun 2017
Location:
Posted: 19th May 2019 14:15
For some reason, some characters just appear as empty spaces. I noticed it with those: h854jsS Changing the font didn't help, but not loading any font did! The string isn't the problem either.

If the text just failed to render, that I could understand. But I have no idea why it just refuses to accept certain characters. I'm quite baffled!

basicFanatic
7
Years of Service
User Offline
Joined: 7th Jun 2017
Location:
Posted: 19th May 2019 18:34
It's these characters it refuses to display. I can't see any pattern:
bhjkqxBGJQSUWXYZ23456789
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 19th May 2019 19:32
how have you declared the maintext

if you've declared it like

mainText=CreateText( string )
it works fine aslong as you other parts of program can see the variable

if you declare mainText like this

#constant mainText=1
createText(mainText,string)

it should not have any problem at all
fubarpk
fubarpk on Itch...………...https://fubarpk.itch.io/
fubarpk on googleplay..https://play.google.com/store/apps/developer?id=fubarpk
basicFanatic
7
Years of Service
User Offline
Joined: 7th Jun 2017
Location:
Posted: 19th May 2019 19:47
It's declared as global, so should be visible enough:

Global mainText as integer
mainText = CreateText("")
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 19th May 2019 19:59
Is it possible that the size of the text needs to be set
I have noticed in the past that the default size is not visible
fubarpk
fubarpk on Itch...………...https://fubarpk.itch.io/
fubarpk on googleplay..https://play.google.com/store/apps/developer?id=fubarpk
basicFanatic
7
Years of Service
User Offline
Joined: 7th Jun 2017
Location:
Posted: 19th May 2019 20:20
I have set setTextSize (mainText, 24.0) already, and was able to get 4.0000 with GetTextSize(mainText)

I forgot to mention this, but I'm using VR and leapmotion, so it's possible that those plugins interfer in some way. But disabling them is a bit of a bother, since they are all over the code.
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 19th May 2019 20:29
not sure about using the plugin but does this sample code work for you
fubarpk
fubarpk on Itch...………...https://fubarpk.itch.io/
fubarpk on googleplay..https://play.google.com/store/apps/developer?id=fubarpk
basicFanatic
7
Years of Service
User Offline
Joined: 7th Jun 2017
Location:
Posted: 19th May 2019 20:42
yeah, that works fine.

As a workaround, I guess I can just use print instead of showing that text. Wouldn't hurt my game any. Still, would really like to know what causes this!
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 19th May 2019 20:51 Edited at: 19th May 2019 20:52
so it may be the drawtext command

from the help file
fubarpk
fubarpk on Itch...………...https://fubarpk.itch.io/
fubarpk on googleplay..https://play.google.com/store/apps/developer?id=fubarpk
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 19th May 2019 20:58
an example that creates an image from text
fubarpk
fubarpk on Itch...………...https://fubarpk.itch.io/
fubarpk on googleplay..https://play.google.com/store/apps/developer?id=fubarpk
basicFanatic
7
Years of Service
User Offline
Joined: 7th Jun 2017
Location:
Posted: 19th May 2019 21:48
... and that just solved it. THANKS!

Turned out placing a Render() before my code block fixed the problem. Not sure why. I've always been a bit confused by those screenie commands.

Login to post a reply

Server time is: 2024-11-22 21:17:13
Your offset time is: 2024-11-22 21:17:13