There is a new version of the forums ready for testing. Please post here if you're willing to help test! We could also use the help of coders!

Author Topic: Anti-aliasing WFN Font from TTF  (Read 1247 times)

Snarky

  • Global Moderator
  • Global Moderator
  • Mittens Lord
  • Private Insultant
    • Best Innovation Award Winner 2018, for his numerous additions to the AGS open source ecosystem including the new Awards Ceremony client and modules
    • Snarky worked on one or more games that won an AGS Award!
    •  
    • Snarky worked on one or more games that was nominated for an AGS Award!
Re: Anti-aliasing WFN Font from TTF
« Reply #20 on: 16 May 2022, 22:25 »
I'm not sure what action.Text is, but basically the function I linked draws text onto a sprite you have to supply. (It's actually a little bit more complicated than that: you have to create a DynamicSprite and then grab its DrawingSurface, which is what the function actually draws on.) Then you set that sprite as e.g. a button graphic, a GUI background, a Graphic Overlay, etc. in order to display it. You can see an example in this thread.

This means, specifically, that if you're currently using a Label to display the text, you'll have to change it a little, since you're rendering a sprite with the text instead. If the text is the only thing on this GUI, I would suggest simply setting the GUI background graphic to this sprite. If there are multiple things on the GUI I would replace the label by a button and set its graphic to the sprite.
« Last Edit: 16 May 2022, 22:30 by Snarky »

Re: Anti-aliasing WFN Font from TTF
« Reply #21 on: 17 May 2022, 15:13 »
I'm not sure what action.Text is, but basically the function I linked draws text onto a sprite you have to supply. (It's actually a little bit more complicated than that: you have to create a DynamicSprite and then grab its DrawingSurface, which is what the function actually draws on.) Then you set that sprite as e.g. a button graphic, a GUI background, a Graphic Overlay, etc. in order to display it. You can see an example in this thread.

This means, specifically, that if you're currently using a Label to display the text, you'll have to change it a little, since you're rendering a sprite with the text instead. If the text is the only thing on this GUI, I would suggest simply setting the GUI background graphic to this sprite. If there are multiple things on the GUI I would replace the label by a button and set its graphic to the sprite.

Thank u for the explanation but I think I'll do it differently which I like better. A gui with background and border over hotspots with the mouse cursor. But I have a problem. Can I post it here or in a new thread?


Edit: No problem anymore, I fixed it.  :)
« Last Edit: 17 May 2022, 15:27 by Amir »
Truly, truly, I say to you, blessed are those who play adventure games, for theirs is the kingdom of heaven.