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 / GetFontSize() bug?

Author
Message
Chmava
11
Years of Service
User Offline
Joined: 20th Jun 2013
Location:
Posted: 10th Feb 2019 11:23
CreateText(999999, "???")
SetTextSize(999999, 64.999)
print(gettextsize(999999))
sync()
sleep(3000)

Return value: 65.000

It claim to return a float but it end up rounding it off?

SetTextSize(999999, 64.5)

return 65.000 as well

Please tell me this is a bug as we need this 100% of the time...

It is fine if it is display 65pixel on screen, but the return value should not be a round up.
puzzler2018
User Banned
Posted: 10th Feb 2019 11:38 Edited at: 10th Feb 2019 11:40
Seems ok for me

Chmava
11
Years of Service
User Offline
Joined: 20th Jun 2013
Location:
Posted: 10th Feb 2019 16:05 Edited at: 10th Feb 2019 16:06
It is going up 1 pixel by pixel for me instead of 1/10 of a pixel?
What version of agk are you using?

It is fine if it round off and render it, but it is not ok in actual value.

I expect it to return 1.1 instead of 2 when going up by 0.1?
puzzler2018
User Banned
Posted: 10th Feb 2019 16:09
Thats odd.

Im currently on 2019.01.18- it may been a bug in an older version perhaps?


Chmava
11
Years of Service
User Offline
Joined: 20th Jun 2013
Location:
Posted: 10th Feb 2019 16:19 Edited at: 10th Feb 2019 16:27
2019.1.18 version

Still the same problem?

GetTextSize() might as well return a integer instead of claiming it return a float, because it does not return a float...

You know those cool minecraft animated text that expand and decrease on the main menu?
Except now we have to use a full 32 bit register to do the calculation instead, what a waste of an extra 4 byte... in ram... actually it's not that big a deal, 4 byte...
puzzler2018
User Banned
Posted: 10th Feb 2019 16:30
Very strange

i created a video of my version..

This is certainly going up and down by .1

Are you using the code i provided or still the code you suggested

Attachments

Login to view attachments
puzzler2018
User Banned
Posted: 10th Feb 2019 16:36 Edited at: 10th Feb 2019 16:41
my mind is not with it at mo - an Integer is 32 bit

Whats a float? is that a 32 bit too ?

What are you trying to calculate at 28 bits? 32-4

Im confused!
puzzler2018
User Banned
Posted: 10th Feb 2019 16:47
Yeah i just seen a Minecraft menu with that Yellow text that seems to explode in and out

Is that something you like to recreate??

I can help if you like?
puzzler2018
User Banned
Posted: 10th Feb 2019 16:54
Hope this helps



Catch up soon
Chmava
11
Years of Service
User Offline
Joined: 20th Jun 2013
Location:
Posted: 10th Feb 2019 17:17 Edited at: 10th Feb 2019 17:18
Now that is weird!
I am using the same code you have posted!
I have attached a video on it.

It is do-able despite this bug and is already done.
I appreciated the help though

Attachments

Login to view attachments
puzzler2018
User Banned
Posted: 10th Feb 2019 17:18
Are you in C++ or Tier 1?

Chmava
11
Years of Service
User Offline
Joined: 20th Jun 2013
Location:
Posted: 10th Feb 2019 17:18
tier 1
Chmava
11
Years of Service
User Offline
Joined: 20th Jun 2013
Location:
Posted: 10th Feb 2019 17:24
Just uninstall and reinstall AppGameKit, same issue?
puzzler2018
User Banned
Posted: 10th Feb 2019 17:25
Just checked and its the

UseNewDefaultFonts( 1 ) // since version 2.0.22 we can use nicer default fonts

remark it out - it uses floats

have it in - it does integers

BUG!!

Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 10th Feb 2019 17:37
Intriguing find .
Green Gandalf of the TGC forums aka Scorpius of the Malevolence:Sword of Ahkranox forums.
Shader developer for Evochron Legacy produced by StarWraith 3D Games.
puzzler2018
User Banned
Posted: 10th Feb 2019 17:52 Edited at: 10th Feb 2019 17:52
Thanks

Not working one


Dammm that looks rubbish!!


Working one



Now that looks miles better
Chmava
11
Years of Service
User Offline
Joined: 20th Jun 2013
Location:
Posted: 10th Feb 2019 18:12 Edited at: 10th Feb 2019 18:12
Intriguing indeed, the document did not mention this at all!
But the new font set use full unicode that support every language in the world!
Be hard to left it out...
I guess an extra 32 bit integer will have to be use to set the font size...
The main reason is due to the same way unity3d handle each frame, Time.DeltaTime().
AGK use getframetime() which act the same way.
This create a very small float number instead of a single pixel.
Wish the developer could just put it back in... kind of stupid as when the text is render, it could then be rounded instead. Assuming it is that way...
Or... it is a BUG!

Also, its a bit slow but it does look nice!
Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 14th Feb 2019 23:38
Unfortunately the new font system isn't really designed for text that constantly changes size, as it draws all characters from scratch based on the desired font size. For example the letter A at size 5 will be different from the letter A at size 10, due to anti-aliasing and available pixel width for the letter. As such the text size is rounded to the nearest pixel size and the letters suitable for that pixel size are chosen. This helps improve the readability of very small text.

I had a look to see if scaling the text smoothly between these pixel sizes made it look any better but it still jumped whenever the letters got redrawn at a new pixel size. For what you are trying to do I would render the text to an image and then apply it to a sprite and scale the sprite instead. Or use the old bitmap fonts as you have discovered.

Login to post a reply

Server time is: 2024-11-23 05:10:28
Your offset time is: 2024-11-23 05:10:28