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

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

Previous topic - Next topic

SSH

Here we go, no longer are you restricted to printing text in one boring colour at a time. No longer are you restricted to less than 100 printable characters. No longer does text need to be printed horizontally! SSH presents.... the Sprite Font module. Includes 4 free example fonts..

Now updated for AGS 3.0 (and 2.72), but v1.02 still available for the 2.71 release.

Download v1.20 here (Requires AGS v2.72beta4a or later (includes AGS 3.0))
Documentation


Download v1.02 here (Requires AGS v2.71 only)

12

SSH

There are lots of fonts to use with this module on this site

I have put a few of them into .cha files for import in this download
12

Joseph DiPerla

Wow, I actual like this Module!

Good Job.
Joseph DiPerla--- http://www.adventurestockpile.com
Play my Star Wars MMORPG: http://sw-bfs.com
See my Fiverr page for translation and other services: https://www.fiverr.com/josephdiperla
Google Plus Adventure Community: https://plus.google.com/communities/116504865864458899575

SSH

#3
I've found an issue if you have a 320x200 game that you set up to run at 640x400, the printing goes awry, so I'll try and fix this at some point..

Edit:

I fixed the bug and uploaded v1.02
12

scourge

Hey this looks really cool! Now i'm gonna upgrade to 2.71.

SSH

Now updated for the latest beta. See first post for details.

btw, Aquilo (or anyone else) please let me know when you release any projects with my modules in, as I love to see my stuff being used!
12

Aquilo

Thanks a lot for this important update. When I release my project (which may take up to a year to complete, because I work solo with no team to speed up the process) I'll surely let you (and everyone else ;) )know. You'll be fully credited, of course. It's the stuff worth being used!
(Here follows a sample of the text written using this module, the font itself is custom):

SSH

Awesome font, Aquilo. Once you've released your game, I'd really encourage you to share the font with others, but of course that is up to you!
12

EnterTheStory (aka tolworthy)

Quote from: SSH on Thu 08/12/2005 16:10:17SSH presents.... the Sprite Font plugin.

This looks like exactly what I want! But can someone clarify if this is a module (from the tppic description) or a plugin (from the above quote)? i.e. would it work on Linux? Sorry of this is a newbie question :)

Scorpiorus

This is a script module and as such should work on any platform supported :)

EnterTheStory (aka tolworthy)


SSH

This will need some adaptation to work with AGS 3.0, unless you turn off the force-object-orientation option
12

Dualnames

Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

SSH

However, now you can use the new version and it works with AGS 3.0+ with no modification! Woot!
12

Simon the Sorcerer

That solved my problem. It wuz an old template(extreeemly old  ;D)
Thanks.

Hello sorcerer fans!

Jakerpot

nice work! but i dont get wow it works, its the new function no? Ok, so i will use an example:
Display("This is so cool! I gained a Super Bannana!") i wanted to change the Supper Bannana to red. How can i apply the module to it? Thanks.



monkey0506

#16
[EDIT:] Actually I was just reading over your post, and I think what you're looking for is the Hypertext module. That should allow you to change the font in the middle of the String...

***********************************

The first post links to the module's documentation. Without actually perusing the code, I'd say that it's not directly possible to create a Display-style box, unless you're using "Always display text as speech" in which case you could do something like this:

Code: ags
// script header
import Overlay* SaySprite(this Character*, String message, bool transparent=true);
import SpriteFont SpriteSpeechFont;

// script body

SpriteFont SpriteSpeechFont;
// ...load sprites into speech font...

void SaySprite(this Character*, String message, bool transparent) {
  DynamicSprite *sprite = SpriteSpeechFont.TextOnSprite(message);
  int width = sprite.Width;
  int height = sprite.Height;
  int x = this.x - (width / 2);
  if ((x + width) > System.ViewportWidth) x = (System.ViewportWidth - width);
  if (x < 0) x = 0;
  ViewFrame *frame = Game.GetViewFrame(this.View, this.Loop, this.Frame);
  int y = (this.y - (((Game.SpriteHeight[frame.Graphic] * this.Scaling) / 100) + height + 2)) - 6;
  if ((y < 0) || ((y + height) > System.ViewportHeight)) y = (System.ViewportHeight - height);
  return Overlay.CreateGraphical(x, y, sprite.Graphic, transparent);
}

// and finally...in any script
player.SaySprite("This is some text in a sprite font displayed over my head.");


Note that this method does *NOT* provide speech animation...for that you'd have to keep track of which character was speaking, how long the text should be displayed, how long the text has already been displayed...if you ask nicely I'm sure you could convince SSH to include a proper speech function into the module code...

SSH

Thanks for replying, yes, I think the Hypertext module would do the trick.
12

StillInThe90s

Hi people! Is anyone still using this module?
Anyway, I gave it a go, but could not make it work.
Is there a step-by-step tutorial or an open source code around?

SSH

I'll try and have a loook at making this work under 3.2 when I have a chance.
12

SMF spam blocked by CleanTalk