MODULE: Sprite fonts v1.20 : multi-coloured text!

Started by SSH, Thu 08/12/2005 16:10:17

Previous topic - Next topic

StillInThe90s

Are you sure this version is not working already?
I could not really tell, see.

StillInThe90s

Anyone knows if ther ever was an update of the sprite fonts -module, compatible with ags 3.2.1?
Thanks.



Not sure where to post this but I guess the good community mods can move this if necessary.
I would have posted in the module topic, but last time I posted in an old thread I got fish in the mail.

Gilbert

Post merged.

It's actually more appropriate to post in the module's own thread than starting a new one in the Technical forum. If you feel it's not right to necro an old thread (which is the case here) you may drop a PM to the author of the module instead.

abstauber

I'm using it for ages and it still works in 3.2.1. Although I'm not sure if I had to adjust a few things.

StillInThe90s

I think I found one of the problems.
The script uses "GetGameParameter" which does not work anymore. Problem is, I don't know how to translate this to "Game.SpriteHeight" and so on, since the manual assumes that I am working with room objects.

Ex:    int height=GetGameParameter(GP_SPRITEHEIGHT, spr, 0, 0);
and:  this.SetFontSprite(firstchar+i, GetGameParameter(GP_FRAMEIMAGE, v, loop, frame));

Ideas?

Khris

1)
Code: ags
  int height = Game.SpriteHeight[spr];


2)
Code: ags
  ViewFrame*vf = Game.GetViewFrame(v, loop, frame);
  this.SetFontSprite(firstchar + i, vf.Graphic);


Didn't test it though.

I believe you can make old commands work again by changing a setting in General settings; replacing them with the current ones is better practice though.

abstauber

In case you don't want to make these edits, here's mine:
http://shatten.sonores.de/wp-content/uploads/2011/04/SpriteFont.zip

Of course Khris' edits are working too :)

StillInThe90s

Hat of to you lads.
However, my scripting skills are not what they ought to be. I still can't get it running, only now it is a question of incompetence. How do I call the mod functions from the global script? I. e. how do I swap from ordinary font to sprite font? Using SSH:s included *.cha seemed easy enough, but no. I have searched the wiki and gone through the doc.

Khris

To be clear, you can't use this font as native speech font or something to that effect, you can only draw it to the background, a DynamicSprite or an Overlay.

So if you want your characters to talk using the sprite font you have to script a replacement for the Character.Say function and use only that.

Calin Leafshade

There is an option in the plugin interface to replace the font renderer.. Someone should make a sprite font renderer for it, that would be nice.

StillInThe90s

Quote from: Khris on Wed 27/04/2011 20:19:48
To be clear, you can't use this font as native speech font or something to that effect, you can only draw it to the background, a DynamicSprite or an Overlay.

So if you want your characters to talk using the sprite font you have to script a replacement for the Character.Say function and use only that.

So this mod is actually no more than a fancy way of showing overlays. Which makes it useless to me if I don't want to rework all of my dialogues...?
Maybe for next project then.

SSH

Find and Replace is your friend. It doesn't take much to create a character.SprSay function. But certainly it won't work with dialog scripts. I like Calin's suggestion, though. Sprint font rendering is pretty simple.

It would probably be better to have another way to import a set of sprites as a script-identifiable group than just using .cha files, though.

I'm pretty sure I did upgrade the module myself at one point, I'll have a look to find it, but no promises!
12

SMF spam blocked by CleanTalk