AGS Awards nominations close at 13:59 GMT on Saturday 10 February 2018. You haven't yet nominated, so you've got 18 days and 16 hours left to play the games and decide which to nominate!

Author Topic: Another Plugin: SpriteFont Renderer. Native Bitmap Fonts.  (Read 18351 times)

Calin Leafshade

  • AGS Project Tracker Admins
  • Long live King Cat!
    • I can help with making music
    •  
    • I can help with voice acting
    •  
    • Calin Leafshade worked on a game that was nominated for an AGS Award!
      Calin Leafshade worked on a game that won an AGS Award!
Ok so a while ago someone (Icey Games i thnk) expressed an interest in using spritefonts because he has totally got the rest of his game down and wanted to add some sparkle.

Now SSH wrote a spritefont module but it was awkward to use since it didnt integrate with the normal ags text functions. This plugin solves that problem.

So you can set a spritefont to override a normal font and just use .Say() or Display() calls and the plugin will draw.

This means you can bypass all the issues with font outlining and stuff just by providing your own, multi coloured, anti aliased, fonts.

Functions

Code: Adventure Game Studio
  1. //sets a fixed width font
  2. void SetSpriteFont(int fontNum, int sprite, int rows, int columns, int charWidth, int charHeight, int charMin, int charMax, bool use32bit)
  3.  

where:

fontNum is the font number you wish to replace.
sprite is the sprite number that contains the sprite font
rows is the number of rows in the font
columns is the number of columns
charWidth is the width of a single character (must all be the same)
charHeight ditto height.
charMin is the lowest ASCII number that the font contains
charMax ditto highest.
use32bit is currently unused and can be either true or false.

the spritefont must be formatted sequentially like this one:



the function for this one would be:

Code: Adventure Game Studio
  1. SetSpriteFont(0, 1,  3, 20, 16, 16, 32, 91, true);
  2.  

Code: Adventure Game Studio
  1. void SetVariableSpriteFont(int fontNum, int sprite);
  2.  

This overrides font 'fontNum' with sprite 'sprite'

Code: Adventure Game Studio
  1. void SetSpacing(int fontNum, int spacing)
  2.  

This allows you to adjust the spacing of a variable width font if its too spread out with drop shadows and stuff

Code: Adventure Game Studio
  1. void SetGlyph(int fontNum, int charNum, int x, int y, int width, int height)
  2.  

This sets a glyph (character) size and location in the spritefont's texture.

I have included a utility which will generate the code for you.

Usage of variable width fonts

- In the archive is a program called SpriteFont.exe. This program will generate variable width sprite fonts for you with shadows and outlines and all kinds of shit.
- The program generates 2 files. The PNG which is the actual font and a file called metrics.xml.
- In the archive there is also AGSSpriteFontGen.exe. This program will take the metrics.xml and convert it to AGSScript that you can copy into your game.

download

The archive contains a demo and all the files needed.

The helper programs need .Net4.0 to run but the plugin itself has no dependencies.

https://dl.dropboxusercontent.com/u/20918686/ags/ags_sprtitefont.zip

What does it look like? Is it better than AGS's normal font renderering?

Yes it is. It looks like this:

« Last Edit: 09 Apr 2015, 22:01 by Dualnames »

Ghost

  • Guest
Looks useful AND easy to use. Downloading now, will report later!

[edit]
Yes, very sweet indeed. Easy to set up and use; and it's really cool to have it "behind the scenes" with all the standard commands still in charge. Thanks for sharing!
« Last Edit: 03 Sep 2011, 01:48 by Ghost »

Calin Leafshade

  • AGS Project Tracker Admins
  • Long live King Cat!
    • I can help with making music
    •  
    • I can help with voice acting
    •  
    • Calin Leafshade worked on a game that was nominated for an AGS Award!
      Calin Leafshade worked on a game that won an AGS Award!
Thanks ghost.

Working on variable width fonts now which will make it much more useful for general purpose stuff but its quite challenging for a c++ novice.

Dualnames

  • Local Moderator
  • Rottwheelers
  • Pretty Badass
    • Dualnames worked on a game that was nominated for an AGS Award!
      Dualnames worked on a game that won an AGS Award!
So from what I'm understanding the restraints so far are:

-Standard size for characters (All characters must have the same width and height).
-Order of characters.

Most font sites actually offer a bitmap containing all the characters of a font in that order, but I haven't browsed bitmap fonts for years, so I can't know.
Regardless this is a nice leap forward.
« Last Edit: 03 Sep 2011, 22:32 by Dualnames »
No more military army stuff. I'm alive and back.

Calin Leafshade

  • AGS Project Tracker Admins
  • Long live King Cat!
    • I can help with making music
    •  
    • I can help with voice acting
    •  
    • Calin Leafshade worked on a game that was nominated for an AGS Award!
      Calin Leafshade worked on a game that won an AGS Award!
Yes, although the characters dont need the same height *and* width. That is to say that they dont have to be square but al the characters need to be the same as each other.

And yea, the characters have to be horizontally sequential according to the ascii codes. Normally they will start with space (char 32) and end with Z (char 90)

Calin Leafshade

  • AGS Project Tracker Admins
  • Long live King Cat!
    • I can help with making music
    •  
    • I can help with voice acting
    •  
    • Calin Leafshade worked on a game that was nominated for an AGS Award!
      Calin Leafshade worked on a game that won an AGS Award!
Updated to support variable width fonts

See first post.

Dualnames

  • Local Moderator
  • Rottwheelers
  • Pretty Badass
    • Dualnames worked on a game that was nominated for an AGS Award!
      Dualnames worked on a game that won an AGS Award!
Updated to support variable width fonts

See first post.

I stand corrected. And I edited my post. :D :D :D
No more military army stuff. I'm alive and back.

Knox

  • Storm Behind The Badge
Dang you Calin!!

Now I have yet another cool thing to add to my ever-expanding/never-ending/forever-bloating project!!

Seems awesome, downloading now :)
--All that is necessary for evil to triumph is for good men to do nothing.

Calin Leafshade

  • AGS Project Tracker Admins
  • Long live King Cat!
    • I can help with making music
    •  
    • I can help with voice acting
    •  
    • Calin Leafshade worked on a game that was nominated for an AGS Award!
      Calin Leafshade worked on a game that won an AGS Award!
Bugs are possible so bug reports would be nice if anyone tries it out.

Monsieur OUXX

  • Cavefish
  • Mittens Vassal
  • Mittens Half Initiate
    • I can help with proof reading
    •  
    • I can help with translating
    •  
    • I can help with voice acting
    •  
Thanks for the variable width functions. That will come handy.
 

Re: Another Plugin: SpriteFont Renderer. Native Bitmap Fonts.
« Reply #10 on: 09 Sep 2011, 06:23 »
This is extremely useful, Calin, thanks a tonne :)

By the way, what kind of license are you providing this under? If it wouldn't be too much trouble, when/if you next update it, could you include a license in the zip?

Calin Leafshade

  • AGS Project Tracker Admins
  • Long live King Cat!
    • I can help with making music
    •  
    • I can help with voice acting
    •  
    • Calin Leafshade worked on a game that was nominated for an AGS Award!
      Calin Leafshade worked on a game that won an AGS Award!
Re: Another Plugin: SpriteFont Renderer. Native Bitmap Fonts.
« Reply #11 on: 09 Sep 2011, 14:26 »
Yea, I'll GPL it or something when I release the code. Everything I do has a *very* liberal license that usually just requires credit.

icey games

  • It's the time of ICEY!!!
Re: Another Plugin: SpriteFont Renderer. Native Bitmap Fonts.
« Reply #12 on: 10 Sep 2011, 04:36 »
yay! I wasn't even aware of this topic. Now I can try and use that font.

Re: Another Plugin: SpriteFont Renderer. Native Bitmap Fonts.
« Reply #13 on: 15 Sep 2011, 16:41 »
Thanks for making an effort Calin! This will be very useful once I get it working properly.
Now, I wonder if someone could have pity and reach out a helping hand to the blind and the deaf of the ags community. I have no idea how to implement this plugin. Is it supposed to work alongside SSHs plugin, or on its own? What code and what files goes where? Do I import the font -png as an ordinary ags sprite?
An open agf -version of the demo might help. Possibly.

Sorry for lowering the intellectual level to kindergarten, everyone.

Khris

    • Lifetime Achievement Award Winner
    •  
    • I can help with play testing
    •  
    • I can help with scripting
    •  
    • I can help with translating
    •  
    • Khris worked on a game that was nominated for an AGS Award!
Re: Another Plugin: SpriteFont Renderer. Native Bitmap Fonts.
« Reply #14 on: 15 Sep 2011, 22:15 »
It's a replacement for SSH's module and allows native commands like Display to use the sprite font.

Copy the dll in AGS' main directory.
Then open your game and check the Plugins node in the project tree. It should get listed there and after you activate it, you can use the additional commands it provides.
The font sprite is imported as usual.

Calin's opening post should explain the rest.

Re: Another Plugin: SpriteFont Renderer. Native Bitmap Fonts.
« Reply #15 on: 16 Sep 2011, 14:31 »
Got it. Thanks!

Set Glyph Glitch?
« Reply #16 on: 14 Sep 2012, 12:01 »
In a game I'm working on I want to use your plugin, I installed it and created a bitmap font:

It's spaced 10x10 to accomodate the largest characters or 'glyphs' on the sprite-sheet.

Then in function game_start() I put this:
Code: Adventure Game Studio
  1. SetSpriteFont(0, 57, 6, 16, 10, 10, 32, 126, false);
  2.   SetSpacing(0, 1);
  3.   SetGlyph(0, 32, 0, 0, 4, 7); //Blank
  4.   SetGlyph(0, 33, 10, 0, 2, 7); //!
  5.   SetGlyph(0, 34, 20, 0, 5, 7); //"
  6.   SetGlyph(0, 35, 30, 0, 6, 7); //#
  7.   SetGlyph(0, 36, 40, 0, 4, 7); //$
  8.   SetGlyph(0, 37, 50, 0, 6, 7); //%
  9.   SetGlyph(0, 38, 60, 0, 4, 7); //&
  10.   SetGlyph(0, 39, 70, 0, 3, 7); //'
  11.   SetGlyph(0, 40, 80, 0, 4, 7); //(
  12.   SetGlyph(0, 41, 90, 0, 4, 7); //)
  13.   SetGlyph(0, 42, 100, 0, 6, 7); //*
  14.   SetGlyph(0, 43, 110, 0, 4, 7); //+
  15.   SetGlyph(0, 44, 120, 0, 3, 7); //,
  16.   SetGlyph(0, 45, 130, 0, 4, 7); //-
  17.   SetGlyph(0, 46, 140, 0, 4, 7); //.
  18.   SetGlyph(0, 47, 150, 0, 5, 7); // /
  19.   //Row2
  20.   SetGlyph(0, 48, 0, 10, 5, 7); //0
  21.   SetGlyph(0, 49, 10, 10, 5, 7); //1
  22.   SetGlyph(0, 50, 20, 10, 5, 7); //2
  23.   SetGlyph(0, 51, 30, 10, 5, 7); //3
  24.   SetGlyph(0, 52, 40, 10, 5, 7); //4
  25.   SetGlyph(0, 53, 50, 10, 5, 7); //5
  26.   SetGlyph(0, 54, 60, 10, 5, 7); //6
  27.   SetGlyph(0, 55, 70, 10, 5, 7); //7
  28.   SetGlyph(0, 56, 80, 10, 5, 7); //8
  29.   SetGlyph(0, 57, 90, 10, 5, 7); //9
  30.   SetGlyph(0, 58, 100, 10, 2, 7); //:
  31.   SetGlyph(0, 59, 110, 10, 3, 7); //;
  32.   SetGlyph(0, 60, 120, 10, 4, 7); //<
  33.   SetGlyph(0, 61, 130, 10, 4, 7); //=
  34.   SetGlyph(0, 62, 140, 10, 4, 7); //>
  35.   SetGlyph(0, 63, 150, 10, 4, 7); // ?
  36.   //Row3
  37.   SetGlyph(0, 64, 0, 20, 8, 7); //@
  38.   SetGlyph(0, 65, 10, 20, 5, 7); //A
  39.   SetGlyph(0, 66, 20, 20, 5, 7); //B
  40.   SetGlyph(0, 67, 30, 20, 5, 7); //C
  41.   SetGlyph(0, 68, 40, 20, 5, 7); //D
  42.   SetGlyph(0, 69, 50, 20, 5, 7); //E
  43.   SetGlyph(0, 70, 60, 20, 5, 7); //F
  44.   SetGlyph(0, 71, 70, 20, 5, 7); //G
  45.   SetGlyph(0, 72, 80, 20, 5, 7); //H
  46.   SetGlyph(0, 73, 90, 20, 4, 7); //I
  47.   SetGlyph(0, 74, 100, 20, 5, 7); //J
  48.   SetGlyph(0, 75, 110, 20, 5, 7); //K
  49.   SetGlyph(0, 76, 120, 20, 5, 7); //L
  50.   SetGlyph(0, 77, 130, 20, 6, 7); //M
  51.   SetGlyph(0, 78, 140, 20, 6, 7); //N
  52.   SetGlyph(0, 79, 150, 20, 5, 7); //O
  53.   //Row4
  54.   SetGlyph(0, 80, 0, 30, 5, 7); //P
  55.   SetGlyph(0, 81, 10, 30, 6, 7); //Q
  56.   SetGlyph(0, 82, 20, 30, 5, 7); //R
  57.   SetGlyph(0, 83, 30, 30, 5, 7); //S
  58.   SetGlyph(0, 84, 40, 30, 6, 7); //T
  59.   SetGlyph(0, 85, 50, 30, 5, 7); //U
  60.   SetGlyph(0, 86, 60, 30, 6, 7); //V
  61.   SetGlyph(0, 87, 70, 30, 6, 7); //W
  62.   SetGlyph(0, 88, 80, 30, 6, 7); //X
  63.   SetGlyph(0, 89, 90, 30, 6, 7); //Y
  64.   SetGlyph(0, 90, 100, 30, 5, 7); //Z
  65.   SetGlyph(0, 91, 110, 30, 3, 7); //[
  66.   SetGlyph(0, 92, 120, 30, 5, 7); // \
  67.   SetGlyph(0, 93, 130, 30, 3, 7); //]
  68.   SetGlyph(0, 94, 140, 30, 4, 7); //^
  69.   SetGlyph(0, 95, 150, 30, 4, 7); //_
  70.   //Row5
  71.   SetGlyph(0, 96, 0, 40, 3, 7); //`
  72.   SetGlyph(0, 97, 10, 40, 5, 7); //a
  73.   SetGlyph(0, 98, 20, 40, 5, 7); //b
  74.   SetGlyph(0, 99, 30, 40, 5, 7); //c
  75.   SetGlyph(0, 100, 40, 40, 5, 7); //d
  76.   SetGlyph(0, 101, 50, 40, 5, 7); //e
  77.   SetGlyph(0, 102, 60, 40, 5, 7); //f
  78.   SetGlyph(0, 103, 70, 40, 5, 7); //g
  79.   SetGlyph(0, 104, 80, 40, 5, 7); //h
  80.   SetGlyph(0, 105, 90, 40, 2, 7); //i
  81.   SetGlyph(0, 106, 100, 40, 4, 7); //j
  82.   SetGlyph(0, 107, 110, 40, 4, 7); //k
  83.   SetGlyph(0, 108, 120, 40, 2, 7); //l
  84.   SetGlyph(0, 109, 130, 40, 6, 7); //m
  85.   SetGlyph(0, 110, 140, 40, 5, 7); //n
  86.   SetGlyph(0, 111, 150, 40, 5, 7); //o
  87.   //Row6
  88.   SetGlyph(0, 112, 0, 50, 5, 7); //p
  89.   SetGlyph(0, 113, 10, 50, 5, 7); //q
  90.   SetGlyph(0, 114, 20, 50, 5, 7); //r
  91.   SetGlyph(0, 115, 30, 50, 5, 7); //s
  92.   SetGlyph(0, 116, 40, 50, 4, 7); //t
  93.   SetGlyph(0, 117, 50, 50, 5, 7); //u
  94.   SetGlyph(0, 118, 60, 50, 6, 7); //v
  95.   SetGlyph(0, 119, 70, 50, 6, 7); //w
  96.   SetGlyph(0, 120, 80, 50, 5, 7); //x
  97.   SetGlyph(0, 121, 90, 50, 5, 7); //y
  98.   SetGlyph(0, 122, 100, 50, 5, 7); //z
  99.   SetGlyph(0, 123, 110, 50, 4, 7); //({)
  100.   SetGlyph(0, 124, 120, 50, 3, 7); //|
  101.   SetGlyph(0, 125, 130, 50, 4, 7); //(})
  102.   SetGlyph(0, 126, 140, 50, 5, 7); //"
  103.   SetGlyph(0, 127, 150, 50, 5, 7); //~
  104.  
Here I've assigned the sprite font sheet at slot 57 over the default ags 0 font and then manually defined each glyph on the sheet, and this works, the problem is it still seems to be spacing it based on '10-10'. How do I fix this? Can I fix this, it's really depressing me at this point.

Calin Leafshade

  • AGS Project Tracker Admins
  • Long live King Cat!
    • I can help with making music
    •  
    • I can help with voice acting
    •  
    • Calin Leafshade worked on a game that was nominated for an AGS Award!
      Calin Leafshade worked on a game that won an AGS Award!
Re: Another Plugin: SpriteFont Renderer. Native Bitmap Fonts.
« Reply #17 on: 14 Sep 2012, 12:40 »
use the function for variable width fonts. currently you are using the fixed width font function.

Re: Another Plugin: SpriteFont Renderer. Native Bitmap Fonts.
« Reply #18 on: 14 Sep 2012, 12:45 »
THANK YOU, I just TOTALLY overlooked that in the documentation, wtheck. It's 7:00am here and I've been awake for hours trying to finish getting my text-box working. Thanks so much for your quick reply, and awesome addon.

Crimson Wizard

  • AGS Project Tracker Admins
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    •  
    • Lifetime Achievement Award Winner
    •  
Re: Another Plugin: SpriteFont Renderer. Native Bitmap Fonts.
« Reply #19 on: 14 Sep 2012, 12:50 »
Sorry, I haven't examine the plugin very closely, but cannot there be some kind of helper function to evade repeating SetGlyph for 100 times?
Here, in charlescreations's example, we have all glyths arranged in similar fashion, just having different widths. Would it be possible to make a function that takes a number of glyths per row, common spacing and array of glyth widths?

Calin Leafshade

  • AGS Project Tracker Admins
  • Long live King Cat!
    • I can help with making music
    •  
    • I can help with voice acting
    •  
    • Calin Leafshade worked on a game that was nominated for an AGS Award!
      Calin Leafshade worked on a game that won an AGS Award!
Re: Another Plugin: SpriteFont Renderer. Native Bitmap Fonts.
« Reply #20 on: 14 Sep 2012, 12:56 »
The setglyph functions are generated by a helper program based on a metrics xml file. parsing the file at runtime was beyond the scope of the plugin.

It's possible that a helper function of some kind could reduce the code required tho.

Knox

  • Storm Behind The Badge
Re: Another Plugin: SpriteFont Renderer. Native Bitmap Fonts.
« Reply #21 on: 03 Dec 2012, 15:29 »
I'd like to re-download this plugin but the link seems to be broken. Would anyone have a copy somewhere?
--All that is necessary for evil to triumph is for good men to do nothing.

JSH

  • Founder of Clifftop Games
    • JSH worked on a game that was nominated for an AGS Award!
      JSH worked on a game that won an AGS Award!
Re: Another Plugin: SpriteFont Renderer. Native Bitmap Fonts.
« Reply #22 on: 21 Jan 2013, 19:19 »
*edit nevermind, better link below :)
« Last Edit: 21 Jan 2013, 22:25 by JSH »

Khris

    • Lifetime Achievement Award Winner
    •  
    • I can help with play testing
    •  
    • I can help with scripting
    •  
    • I can help with translating
    •  
    • Khris worked on a game that was nominated for an AGS Award!
Re: Another Plugin: SpriteFont Renderer. Native Bitmap Fonts.
« Reply #23 on: 21 Jan 2013, 19:40 »
Could you upload the helper programs, too?

Or could you, Calin?

Somebody?

Calin Leafshade

  • AGS Project Tracker Admins
  • Long live King Cat!
    • I can help with making music
    •  
    • I can help with voice acting
    •  
    • Calin Leafshade worked on a game that was nominated for an AGS Award!
      Calin Leafshade worked on a game that won an AGS Award!
Re: Another Plugin: SpriteFont Renderer. Native Bitmap Fonts.
« Reply #24 on: 21 Jan 2013, 20:43 »
I managed to find the original archive from my server dump and reuploaded it. It should have all the helper programs and shit in it.

http://www.sanctuary-interactive.com/~steve/agspritefont2.zip

Daniel Thomas

  • "zyndikate"
    • Daniel Thomas worked on a game that was nominated for an AGS Award!
      Daniel Thomas worked on a game that won an AGS Award!
Re: Another Plugin: SpriteFont Renderer. Native Bitmap Fonts.
« Reply #25 on: 22 Jan 2013, 07:15 »
Does this work with D3D? I know the obvious answer would be 'no' since I get the error message saying it doesn't, but I don't see it mentioned in the post - so hoping that I might have overlooked something?
Check out The Journey of Iesir Demo | Freelance artist, check out my Portfolio

Calin Leafshade

  • AGS Project Tracker Admins
  • Long live King Cat!
    • I can help with making music
    •  
    • I can help with voice acting
    •  
    • Calin Leafshade worked on a game that was nominated for an AGS Award!
      Calin Leafshade worked on a game that won an AGS Award!
Re: Another Plugin: SpriteFont Renderer. Native Bitmap Fonts.
« Reply #26 on: 22 Jan 2013, 08:15 »
There's no reason it shouldnt work in D3D...

Whats the error?

Daniel Thomas

  • "zyndikate"
    • Daniel Thomas worked on a game that was nominated for an AGS Award!
      Daniel Thomas worked on a game that won an AGS Award!
Re: Another Plugin: SpriteFont Renderer. Native Bitmap Fonts.
« Reply #27 on: 22 Jan 2013, 09:32 »
When trying the SpriteFontTest.exe with D3D I get this right before the text should appear:

in "room1.asc",line 5
from "room1.asc",line 28
Error: This plugin is not compatible with the Direct3D driver

Check out The Journey of Iesir Demo | Freelance artist, check out my Portfolio

Calin Leafshade

  • AGS Project Tracker Admins
  • Long live King Cat!
    • I can help with making music
    •  
    • I can help with voice acting
    •  
    • Calin Leafshade worked on a game that was nominated for an AGS Award!
      Calin Leafshade worked on a game that won an AGS Award!
Re: Another Plugin: SpriteFont Renderer. Native Bitmap Fonts.
« Reply #28 on: 22 Jan 2013, 09:35 »
Which function is causing that error?

Daniel Thomas

  • "zyndikate"
    • Daniel Thomas worked on a game that was nominated for an AGS Award!
      Daniel Thomas worked on a game that won an AGS Award!
Re: Another Plugin: SpriteFont Renderer. Native Bitmap Fonts.
« Reply #29 on: 22 Jan 2013, 09:58 »
When trying with DD5 the first text-message is a Display(), based on what text message say.
Check out The Journey of Iesir Demo | Freelance artist, check out my Portfolio

JJS

  • AGS Project Tracker Admins
    • Best Innovation Award Winner 2012, for his efforts in porting AGS to multiple platforms
    •  
Re: Another Plugin: SpriteFont Renderer. Native Bitmap Fonts.
« Reply #30 on: 22 Jan 2013, 10:26 »
Which function is causing that error?
Probably engine->GetVirtualScreen(). It is not possible to get the screen contents when using the D3D driver. Funnily enough, the function is called in the plugin but the result is never used.
Ask me about AGS on PSP, Android and iOS! Source, Daily builds

Calin Leafshade

  • AGS Project Tracker Admins
  • Long live King Cat!
    • I can help with making music
    •  
    • I can help with voice acting
    •  
    • Calin Leafshade worked on a game that was nominated for an AGS Award!
      Calin Leafshade worked on a game that won an AGS Award!
Re: Another Plugin: SpriteFont Renderer. Native Bitmap Fonts.
« Reply #31 on: 22 Jan 2013, 10:35 »
Yes, I thought there shouldnt be any good reason why it doesnt work in D3D.. and theres is the no-good reason.

Easy enough to fix. I will do so when i am next at home unless the miraculous happens and someone fixes it before me.

Re: Another Plugin: SpriteFont Renderer. Native Bitmap Fonts.
« Reply #32 on: 24 Jan 2013, 15:14 »
Any way of setting the font colour used separate from the sprite? So if you wanted it displayed in black, it would be?
Stuart "Sslaxx" Moore.

Re: Another Plugin: SpriteFont Renderer. Native Bitmap Fonts.
« Reply #33 on: 24 Jan 2013, 18:31 »
Hi!
This plugin is fantastic, I've just downloaded the files and run the exe... But I can't see a way to install the plugin. It looks there are not scm files.
I know, excuse me but I'm new and I can't speak English very well so I can't understand everything! Thanks! :)

Khris

    • Lifetime Achievement Award Winner
    •  
    • I can help with play testing
    •  
    • I can help with scripting
    •  
    • I can help with translating
    •  
    • Khris worked on a game that was nominated for an AGS Award!
Re: Another Plugin: SpriteFont Renderer. Native Bitmap Fonts.
« Reply #34 on: 24 Jan 2013, 19:27 »
scm files are script modules; plugins are dll files.
Four of them are from the SpriteFont program, you only need "apsspritefont.dll".
With AGSEditor not running, copy it into the same dir. Then open your game. The plugin should now appear in the project tree. Right-click it and click on "Use this plugin".

Calin Leafshade

  • AGS Project Tracker Admins
  • Long live King Cat!
    • I can help with making music
    •  
    • I can help with voice acting
    •  
    • Calin Leafshade worked on a game that was nominated for an AGS Award!
      Calin Leafshade worked on a game that won an AGS Award!
Re: Another Plugin: SpriteFont Renderer. Native Bitmap Fonts.
« Reply #35 on: 24 Jan 2013, 22:08 »
Any way of setting the font colour used separate from the sprite? So if you wanted it displayed in black, it would be?

Not currently but I dont see any reason why that wouldnt be possible.




Re: Another Plugin: SpriteFont Renderer. Native Bitmap Fonts.
« Reply #36 on: 26 Jan 2013, 19:02 »
Thanks, Khris!
Now... I'm sorry, but I have another problem. I used the exe files, I made the metric file and the sprite font. Then I loaded it in AGS Sprites, and I copied the code in game start function, but it still doesn't work. Where's the mistake?... Thanks!

Khris

    • Lifetime Achievement Award Winner
    •  
    • I can help with play testing
    •  
    • I can help with scripting
    •  
    • I can help with translating
    •  
    • Khris worked on a game that was nominated for an AGS Award!
Re: Another Plugin: SpriteFont Renderer. Native Bitmap Fonts.
« Reply #37 on: 26 Jan 2013, 19:37 »
Pretty difficult to see the mistake without looking at your code, right...?

Daniel Thomas

  • "zyndikate"
    • Daniel Thomas worked on a game that was nominated for an AGS Award!
      Daniel Thomas worked on a game that won an AGS Award!
Re: Another Plugin: SpriteFont Renderer. Native Bitmap Fonts.
« Reply #38 on: 14 Feb 2013, 22:52 »
Out of curiosity, any updates on this?
Sslaxx suggestion sound great(if I even understood it correctly), and if it would use the color of the character text color setting it would be the icing on the cake IMO. :)
Check out The Journey of Iesir Demo | Freelance artist, check out my Portfolio

Calin Leafshade

  • AGS Project Tracker Admins
  • Long live King Cat!
    • I can help with making music
    •  
    • I can help with voice acting
    •  
    • Calin Leafshade worked on a game that was nominated for an AGS Award!
      Calin Leafshade worked on a game that won an AGS Award!
Re: Another Plugin: SpriteFont Renderer. Native Bitmap Fonts.
« Reply #39 on: 14 Feb 2013, 23:12 »
Sorry I completely forgot.

I'll pull the repo tomorrow when my NEW COMPUTER arrives and I'll see if I can add colouring and fix the D3D problem on my NEW COMPUTER.

...

NEW COMPUTER

san.daniele

    • I can help with story design
    •  
    • I can help with translating
    •  
    • I can help with voice acting
    •  
    • I can help with web design
    •  
    • san.daniele worked on a game that was nominated for an AGS Award!
Re: Another Plugin: SpriteFont Renderer. Native Bitmap Fonts.
« Reply #40 on: 14 Apr 2013, 20:24 »
This Sir probably saved me weeks of worktime!
I made a custom font for my game and was extremely happy with it (any existing font would have destroyed the whole look). But had no idea how to implement it. Your plugin is better than I could have ever expected … and only took me a few hours to get it working (well, I am an absolute beginner and at first I did everything wrong that could be done wrong ;) ).

Short: Thanks so much!!
« Last Edit: 18 Apr 2013, 09:24 by san.daniele »

san.daniele

    • I can help with story design
    •  
    • I can help with translating
    •  
    • I can help with voice acting
    •  
    • I can help with web design
    •  
    • san.daniele worked on a game that was nominated for an AGS Award!
Re: Another Plugin: SpriteFont Renderer. Native Bitmap Fonts.
« Reply #41 on: 18 Apr 2013, 09:33 »
When reworking my custom font and playing around with some glyphs I decided to use a variable width instead of a fixed one.

Unfortunately, now the line breaks don't work anymore. Everything is just written in one line. When there should be a line break, it just jumps to the beginning of the same line and draws the next letters on top of the previous ones. I could work around it using a lot of %s but I'm sure I'm just missing an obvious detail. How do I set the line spacing?

here's the code I'm using. As soon as I'm deleting SetVariableSpriteFont all lines break perfectly.

Code: Adventure Game Studio
  1.  
  2. // SetSpriteFont(0, 18, 5, 20, 43, 45, 32, 122, false);  //Custom Font
  3.  
  4.   SetVariableSpriteFont(0, 18);
  5.   SetSpacing(0, 5);
  6.  
  7.   //SetGlyph(int fontNum, int charNum, int x, int y, int width, int height)
  8.  
  9.    SetGlyph(0, 48, 688, 7, 27, 38); //0
  10.   SetGlyph(0, 49, 731, 7, 20, 38); //1
  11.   SetGlyph(0, 50, 774, 7, 27, 38); //2
  12.   SetGlyph(0, 51, 817, 7, 27, 38); //3
  13.   SetGlyph(0, 52, 0, 52, 27, 38); //4
  14.  

JSH

  • Founder of Clifftop Games
    • JSH worked on a game that was nominated for an AGS Award!
      JSH worked on a game that won an AGS Award!
Re: Another Plugin: SpriteFont Renderer. Native Bitmap Fonts.
« Reply #42 on: 18 Apr 2013, 10:12 »
Sorry I completely forgot.

I'll pull the repo tomorrow when my NEW COMPUTER arrives and I'll see if I can add colouring and fix the D3D problem on my NEW COMPUTER.

...

NEW COMPUTER

I hate to be that guy, but we're still waiting for this?

Daniel Thomas

  • "zyndikate"
    • Daniel Thomas worked on a game that was nominated for an AGS Award!
      Daniel Thomas worked on a game that won an AGS Award!
Re: Another Plugin: SpriteFont Renderer. Native Bitmap Fonts.
« Reply #43 on: 18 Apr 2013, 13:31 »
Thanks Joel, that means I didn't have to be the guy. :)

In other words, I'm also still interesting in this - I didn't want to bother as I assumed you were too busy.
Check out The Journey of Iesir Demo | Freelance artist, check out my Portfolio

Calin Leafshade

  • AGS Project Tracker Admins
  • Long live King Cat!
    • I can help with making music
    •  
    • I can help with voice acting
    •  
    • Calin Leafshade worked on a game that was nominated for an AGS Award!
      Calin Leafshade worked on a game that won an AGS Award!
Re: Another Plugin: SpriteFont Renderer. Native Bitmap Fonts.
« Reply #44 on: 18 Apr 2013, 16:13 »
My apologies, I completely forgot.

I shall begin today!

Calin Leafshade

  • AGS Project Tracker Admins
  • Long live King Cat!
    • I can help with making music
    •  
    • I can help with voice acting
    •  
    • Calin Leafshade worked on a game that was nominated for an AGS Award!
      Calin Leafshade worked on a game that won an AGS Award!
Re: Another Plugin: SpriteFont Renderer. Native Bitmap Fonts.
« Reply #45 on: 18 Apr 2013, 18:05 »
Ok new version here: https://dl.dropboxusercontent.com/u/27247158/ags-spritefont-plugin.dll

The filename has changed to match the reorganisation so make sure you delete the old version from your game directory and the ags directory.

All the functions and stuff are the same so it should be a drop in replacement.

When reworking my custom font and playing around with some glyphs I decided to use a variable width instead of a fixed one.

Unfortunately, now the line breaks don't work anymore. Everything is just written in one line. When there should be a line break, it just jumps to the beginning of the same line and draws the next letters on top of the previous ones. I could work around it using a lot of %s but I'm sure I'm just missing an obvious detail. How do I set the line spacing?

I can't reproduce this. For me line breaks work fine as seen here:



Yes, I thought there shouldnt be any good reason why it doesnt work in D3D.. and theres is the no-good reason.

Easy enough to fix. I will do so when i am next at home unless the miraculous happens and someone fixes it before me.

This is also fixed. The plugin now works in D3D

I will tackle the font tinting next.

Github: https://github.com/CalinLeafshade/ags-spritefont

san.daniele

    • I can help with story design
    •  
    • I can help with translating
    •  
    • I can help with voice acting
    •  
    • I can help with web design
    •  
    • san.daniele worked on a game that was nominated for an AGS Award!
Re: Another Plugin: SpriteFont Renderer. Native Bitmap Fonts.
« Reply #46 on: 18 Apr 2013, 19:14 »

When reworking my custom font and playing around with some glyphs I decided to use a variable width instead of a fixed one.

Unfortunately, now the line breaks don't work anymore. Everything is just written in one line. When there should be a line break, it just jumps to the beginning of the same line and draws the next letters on top of the previous ones. I could work around it using a lot of %s but I'm sure I'm just missing an obvious detail. How do I set the line spacing?

I can't reproduce this. For me line breaks work fine as seen here:


I fixed it myself (well, "fixed" is a big word). I only tested it with numbers 0-9. Now I defined all 90 characters with SetGlyph and voilá: all works fine (maybe that makes sense to you).

I don't understand why this plugin doesn't get more love (like an insane amount). It's just amazing and I'm quite sure I'm going to use it for every project I'm going to do in AGS. So thanks again.
(or maybe I just didn't realize yet that there are several other plugins/methods to use a custom font).

Calin Leafshade

  • AGS Project Tracker Admins
  • Long live King Cat!
    • I can help with making music
    •  
    • I can help with voice acting
    •  
    • Calin Leafshade worked on a game that was nominated for an AGS Award!
      Calin Leafshade worked on a game that won an AGS Award!
Re: Another Plugin: SpriteFont Renderer. Native Bitmap Fonts.
« Reply #47 on: 18 Apr 2013, 19:54 »
No one ever likes my plugins :(

Calin Leafshade

  • AGS Project Tracker Admins
  • Long live King Cat!
    • I can help with making music
    •  
    • I can help with voice acting
    •  
    • Calin Leafshade worked on a game that was nominated for an AGS Award!
      Calin Leafshade worked on a game that won an AGS Award!

Daniel Thomas

  • "zyndikate"
    • Daniel Thomas worked on a game that was nominated for an AGS Award!
      Daniel Thomas worked on a game that won an AGS Award!
Re: Another Plugin: SpriteFont Renderer. Native Bitmap Fonts.
« Reply #49 on: 20 Apr 2013, 05:44 »
I can confirm that it works now, both tinting and using it in D3D.

There seem to be a transparency problem when used for dialogues (a room with a background image). Seems to work fine when used over a GUI though - so I suspect it's the AGS transparency limitation which is causing this?

(Your plugins should get some more love, it does fix some of the AGS limitations, but I suspect it's just a minority of the developers who think it's a problem)
« Last Edit: 20 Apr 2013, 05:46 by Daniel Thomas »
Check out The Journey of Iesir Demo | Freelance artist, check out my Portfolio

Calin Leafshade

  • AGS Project Tracker Admins
  • Long live King Cat!
    • I can help with making music
    •  
    • I can help with voice acting
    •  
    • Calin Leafshade worked on a game that was nominated for an AGS Award!
      Calin Leafshade worked on a game that won an AGS Award!
Re: Another Plugin: SpriteFont Renderer. Native Bitmap Fonts.
« Reply #50 on: 20 Apr 2013, 05:57 »
There seem to be a transparency problem when used for dialogues (a room with a background image). Seems to work fine when used over a GUI though - so I suspect it's the AGS transparency limitation which is causing this?

Is "Antialias Truetype fonts" set to true in the options? AGS doesnt provide a 32-bit canvas to draw fonts on unless that is selected and so transparency will completely mess up.

Daniel Thomas

  • "zyndikate"
    • Daniel Thomas worked on a game that was nominated for an AGS Award!
      Daniel Thomas worked on a game that won an AGS Award!
Re: Another Plugin: SpriteFont Renderer. Native Bitmap Fonts.
« Reply #51 on: 20 Apr 2013, 06:06 »
Yes, that fixed it. :)

« Last Edit: 20 Apr 2013, 06:07 by Daniel Thomas »
Check out The Journey of Iesir Demo | Freelance artist, check out my Portfolio

selmiak

  • ǝsıɔɹǝxǝ ʞɔǝu puɐ uıɐɹq
    • I can help with play testing
    •  
    • I can help with proof reading
    •  
    • I can help with translating
    •  
    • I can help with web design
    •  
    • selmiak worked on a game that was nominated for an AGS Award!
Re: Another Plugin: SpriteFont Renderer. Native Bitmap Fonts.
« Reply #52 on: 24 Apr 2013, 12:05 »
is there a way to apply this to guis and especially text displayed on buttons and textboxes?

Calin Leafshade

  • AGS Project Tracker Admins
  • Long live King Cat!
    • I can help with making music
    •  
    • I can help with voice acting
    •  
    • Calin Leafshade worked on a game that was nominated for an AGS Award!
      Calin Leafshade worked on a game that won an AGS Award!
Re: Another Plugin: SpriteFont Renderer. Native Bitmap Fonts.
« Reply #53 on: 24 Apr 2013, 12:09 »
Yes, it will work anywhere where a font is rendered.

However it wont show up on the preview in the editor because the plugin is only loaded at runtime and theres nothing i can do about that.

But the example picture i posted is text on a GUI label.

Ghost

  • AGS Baker
  • Rottwheelers
  • Simple plans can work.
    • Ghost worked on a game that was nominated for an AGS Award!
      Ghost worked on a game that won an AGS Award!
Re: Another Plugin: SpriteFont Renderer. Native Bitmap Fonts.
« Reply #54 on: 26 Apr 2013, 17:35 »
No one ever likes my plugins :(

I am loving this!

san.daniele

    • I can help with story design
    •  
    • I can help with translating
    •  
    • I can help with voice acting
    •  
    • I can help with web design
    •  
    • san.daniele worked on a game that was nominated for an AGS Award!
Re: Another Plugin: SpriteFont Renderer. Native Bitmap Fonts.
« Reply #55 on: 27 Apr 2013, 12:09 »
There seem to be a transparency problem when used for dialogues (a room with a background image). Seems to work fine when used over a GUI though - so I suspect it's the AGS transparency limitation which is causing this?

Is "Antialias Truetype fonts" set to true in the options? AGS doesnt provide a 32-bit canvas to draw fonts on unless that is selected and so transparency will completely mess up.

I'm having a transparency issue as well. If the text is displayed in a GUI, it looks messed up if the GUI is transparent or the GUI background has an alpha channel. All sprites are 32-bit (of course game set to that as well) and Antialias Font set to true. The room background has no alpha channel.

I've been playing around with it for hours now without finding any solution. If wanted, I can upload an example dialog I quickly set up in the AGS Demo Game.
Am I missing something?

I found several topics about problems using transparency over an already (semi-)transparent GUI (most of them being a little over my head). But everything works fine using transparent sprites in a transparent inventory GUI, so my guess is it has something to do with the font rendering.

edit: actually, I should specify a little more. It kinda recognices the general transparent area around the characters, but looses all details.
Instead of explaining, here's two screenshots:

here's how a simple Say("") or Display("") looks like:

and here's what happens if inside a transparent gui
« Last Edit: 27 Apr 2013, 12:29 by san.daniele »

Calin Leafshade

  • AGS Project Tracker Admins
  • Long live King Cat!
    • I can help with making music
    •  
    • I can help with voice acting
    •  
    • Calin Leafshade worked on a game that was nominated for an AGS Award!
      Calin Leafshade worked on a game that won an AGS Award!
Re: Another Plugin: SpriteFont Renderer. Native Bitmap Fonts.
« Reply #56 on: 27 Apr 2013, 18:01 »
I can't reproduce the issue.

A demonstration game with the source would be useful.

san.daniele

    • I can help with story design
    •  
    • I can help with translating
    •  
    • I can help with voice acting
    •  
    • I can help with web design
    •  
    • san.daniele worked on a game that was nominated for an AGS Award!
Re: Another Plugin: SpriteFont Renderer. Native Bitmap Fonts.
« Reply #57 on: 27 Apr 2013, 21:12 »
http://www.whalesplash.com/CrossStitchCasper/Examples/FontGame.zip

The .zip might look a little messed up as I packed it using my mac.
I hope that's all you need. There's some sprites in there to test inventory item/font. just start it and talk to the 2nd character in the room.

If you miss anything just tell me and I'll add it right away.


Calin Leafshade

  • AGS Project Tracker Admins
  • Long live King Cat!
    • I can help with making music
    •  
    • I can help with voice acting
    •  
    • Calin Leafshade worked on a game that was nominated for an AGS Award!
      Calin Leafshade worked on a game that won an AGS Award!
Re: Another Plugin: SpriteFont Renderer. Native Bitmap Fonts.
« Reply #58 on: 28 Apr 2013, 18:17 »
That looks to be a bug in AGS's TextWindow system. I will forward it on to the engine team.

Crimson Wizard

  • AGS Project Tracker Admins
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    •  
    • Lifetime Achievement Award Winner
    •  
Re: Another Plugin: SpriteFont Renderer. Native Bitmap Fonts.
« Reply #59 on: 28 Apr 2013, 19:10 »
I am yet to check this, but it looks like the bug I was fixing recently, related to alpha blending on gui:
http://www.adventuregamestudio.co.uk/forums/index.php?topic=47666.0

Calin Leafshade

  • AGS Project Tracker Admins
  • Long live King Cat!
    • I can help with making music
    •  
    • I can help with voice acting
    •  
    • Calin Leafshade worked on a game that was nominated for an AGS Award!
      Calin Leafshade worked on a game that won an AGS Award!
Re: Another Plugin: SpriteFont Renderer. Native Bitmap Fonts.
« Reply #60 on: 28 Apr 2013, 19:15 »
I dont think so. It seems to only be related to TextWindow GUIs. Font rendering on other GUIs works fine.

Crimson Wizard

  • AGS Project Tracker Admins
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    •  
    • Lifetime Achievement Award Winner
    •  
Re: Another Plugin: SpriteFont Renderer. Native Bitmap Fonts.
« Reply #61 on: 28 Apr 2013, 19:42 »
Hmm, well, at the moment I can tell only that the surface bitmap IS 32-bit. But the drawing algorythm there is a bit complicated...

E: I believe it is related strictly to magic pink (transparent color). I've already saw similar problems when blending translucent buttons over gui with magic pink areas.

EE: I must be mistaken. Although the surface seem to be 32-bit, the alpha channel is definitely lost at some point. More simple way to see this is to assign translucent sprite as Text Window background.
This might be due some drawing operation used.


EEE: Ok, the last guess was right, it simply discarded alpha channel at the point of creating a renderer-compatible bitmap.
Quick-fix won't do, because simply forcing alpha there will make text window borders dissapear :).
Need more careful approach.
« Last Edit: 28 Apr 2013, 20:07 by Crimson Wizard »

san.daniele

    • I can help with story design
    •  
    • I can help with translating
    •  
    • I can help with voice acting
    •  
    • I can help with web design
    •  
    • san.daniele worked on a game that was nominated for an AGS Award!
Re: Another Plugin: SpriteFont Renderer. Native Bitmap Fonts.
« Reply #62 on: 28 Apr 2013, 20:19 »
It seems to only be related to TextWindow GUIs. Font rendering on other GUIs works fine.

It's even more specific. Using SetTextWindowGUI has no problems with rendering the text in said TextGUI. It's just the dialog options that don't work.

p.s. does it make sense to discuss this further in here? As this is apparently only remotely related to the plugin.

Crimson Wizard

  • AGS Project Tracker Admins
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    •  
    • Lifetime Achievement Award Winner
    •  
Re: Another Plugin: SpriteFont Renderer. Native Bitmap Fonts.
« Reply #63 on: 28 Apr 2013, 20:23 »
p.s. does it make sense to discuss this further in here? As this is apparently only remotely related to the plugin.
Right, sorry. Calin made the issue post here: http://www.adventuregamestudio.co.uk/forums/index.php?issue=405.0

Knox

  • Storm Behind The Badge
Re: Another Plugin: SpriteFont Renderer. Native Bitmap Fonts.
« Reply #64 on: 15 Sep 2013, 20:04 »
(Sorry for re-opening)

Everything worked great with this plugin up until now: I was fiddling with it today (since looking into how to maybe make my own) and I'm not sure but perhaps I found a possible bug?

If my GUI label is set to "Inventory" from within the editor at the start of the game, but then I change it via script later after a button is pressed to something else ("Closeup", for example),
Code: Adventure Game Studio
  1. lblInventoryTitle.Text = "Closeup";

...the new title text gets clipped after the 1st character (All I see is "C" as the GUI's new title).
To debug, I tested this using a standard font, and the title switches without that clipping.

What would I have to do to get around that?
--All that is necessary for evil to triumph is for good men to do nothing.

Calin Leafshade

  • AGS Project Tracker Admins
  • Long live King Cat!
    • I can help with making music
    •  
    • I can help with voice acting
    •  
    • Calin Leafshade worked on a game that was nominated for an AGS Award!
      Calin Leafshade worked on a game that won an AGS Award!
Re: Another Plugin: SpriteFont Renderer. Native Bitmap Fonts.
« Reply #65 on: 15 Sep 2013, 21:17 »
Could you try making the label a little taller.

I think it might not be cutting it off but rather forcing new lines. See if the rest of the text is just on a new line.

Knox

  • Storm Behind The Badge
Re: Another Plugin: SpriteFont Renderer. Native Bitmap Fonts.
« Reply #66 on: 15 Sep 2013, 23:46 »
Ok so I tried making the label taller (even really tall values like 400, to test)...still everything but the 1st character gets truncated. I'll continue to do more tests to see if I can pinpoint it.

Ok so I found the prob: my font sheet only has capital letters, so yeah, I'm retarded, lol! :tongue:
« Last Edit: 15 Sep 2013, 23:53 by General_Knox »
--All that is necessary for evil to triumph is for good men to do nothing.

Daniel Eakins

  • Time Traveller
Re: Another Plugin: SpriteFont Renderer. Native Bitmap Fonts.
« Reply #67 on: 29 Oct 2013, 16:20 »
Okay dumb question time: where do I put the PNG file that SpriteFont.exe produces? :confused:

My game_start function looks like this and obviously it's missing something to work but I don't know what:
Code: Adventure Game Studio
  1. function game_start()
  2. {
  3.         SetGlyph(0, 32, 8, 8, 3, 14);
  4.         SetGlyph(0, 33, 19, 8, 1, 14);
  5.         SetGlyph(0, 34, 28, 8, 3, 14);
  6.         SetGlyph(0, 35, 39, 8, 5, 14);
  7.         SetGlyph(0, 36, 52, 8, 5, 14);
  8.         SetGlyph(0, 37, 65, 8, 7, 14);
  9.         SetGlyph(0, 38, 80, 8, 4, 14);
  10.         SetGlyph(0, 39, 92, 8, 1, 14);
  11.         SetGlyph(0, 40, 101, 8, 2, 14);
  12.         SetGlyph(0, 41, 111, 8, 2, 14);
  13.         SetGlyph(0, 42, 121, 8, 5, 14);
  14.         SetGlyph(0, 43, 134, 8, 5, 14);
  15.         SetGlyph(0, 44, 147, 8, 2, 14);
  16.         SetGlyph(0, 45, 157, 8, 3, 14);
  17.         SetGlyph(0, 46, 168, 8, 1, 14);
  18.         SetGlyph(0, 47, 177, 8, 5, 14);
  19.         SetGlyph(0, 48, 8, 30, 4, 14);
  20.         SetGlyph(0, 49, 20, 30, 2, 14);
  21.         SetGlyph(0, 50, 30, 30, 4, 14);
  22.         SetGlyph(0, 51, 42, 30, 4, 14);
  23.         SetGlyph(0, 52, 54, 30, 4, 14);
  24.         SetGlyph(0, 53, 66, 30, 4, 14);
  25.         SetGlyph(0, 54, 78, 30, 4, 14);
  26.         SetGlyph(0, 55, 90, 30, 4, 14);
  27.         SetGlyph(0, 56, 102, 30, 4, 14);
  28.         SetGlyph(0, 57, 114, 30, 4, 14);
  29.         SetGlyph(0, 58, 126, 30, 1, 14);
  30.         SetGlyph(0, 59, 135, 30, 2, 14);
  31.         SetGlyph(0, 60, 145, 30, 3, 14);
  32.         SetGlyph(0, 61, 156, 30, 3, 14);
  33.         SetGlyph(0, 62, 167, 30, 3, 14);
  34.         SetGlyph(0, 63, 178, 30, 4, 14);
  35.         SetGlyph(0, 64, 8, 52, 8, 14);
  36.         SetGlyph(0, 65, 24, 52, 4, 14);
  37.         SetGlyph(0, 66, 36, 52, 4, 14);
  38.         SetGlyph(0, 67, 48, 52, 4, 14);
  39.         SetGlyph(0, 68, 60, 52, 4, 14);
  40.         SetGlyph(0, 69, 72, 52, 4, 14);
  41.         SetGlyph(0, 70, 84, 52, 4, 14);
  42.         SetGlyph(0, 71, 96, 52, 4, 14);
  43.         SetGlyph(0, 72, 108, 52, 4, 14);
  44.         SetGlyph(0, 73, 120, 52, 1, 14);
  45.         SetGlyph(0, 74, 129, 52, 3, 14);
  46.         SetGlyph(0, 75, 140, 52, 4, 14);
  47.         SetGlyph(0, 76, 152, 52, 3, 14);
  48.         SetGlyph(0, 77, 163, 52, 5, 14);
  49.         SetGlyph(0, 78, 176, 52, 5, 14);
  50.         SetGlyph(0, 79, 189, 52, 4, 14);
  51.         SetGlyph(0, 80, 8, 74, 4, 14);
  52.         SetGlyph(0, 81, 20, 74, 4, 14);
  53.         SetGlyph(0, 82, 32, 74, 4, 14);
  54.         SetGlyph(0, 83, 44, 74, 4, 14);
  55.         SetGlyph(0, 84, 56, 74, 5, 14);
  56.         SetGlyph(0, 85, 69, 74, 4, 14);
  57.         SetGlyph(0, 86, 81, 74, 5, 14);
  58.         SetGlyph(0, 87, 94, 74, 5, 14);
  59.         SetGlyph(0, 88, 107, 74, 4, 14);
  60.         SetGlyph(0, 89, 119, 74, 5, 14);
  61.         SetGlyph(0, 90, 132, 74, 4, 14);
  62.         SetGlyph(0, 91, 144, 74, 2, 14);
  63.         SetGlyph(0, 92, 154, 74, 5, 14);
  64.         SetGlyph(0, 93, 167, 74, 2, 14);
  65.         SetGlyph(0, 94, 177, 74, 3, 14);
  66.         SetGlyph(0, 95, 188, 74, 3, 14);
  67.         SetGlyph(0, 96, 8, 96, 2, 14);
  68.         SetGlyph(0, 97, 18, 96, 4, 14);
  69.         SetGlyph(0, 98, 30, 96, 4, 14);
  70.         SetGlyph(0, 99, 42, 96, 4, 14);
  71.         SetGlyph(0, 100, 54, 96, 4, 14);
  72.         SetGlyph(0, 101, 66, 96, 4, 14);
  73.         SetGlyph(0, 102, 78, 96, 3, 14);
  74.         SetGlyph(0, 103, 89, 96, 4, 14);
  75.         SetGlyph(0, 104, 101, 96, 4, 14);
  76.         SetGlyph(0, 105, 113, 96, 1, 14);
  77.         SetGlyph(0, 106, 122, 96, 2, 14);
  78.         SetGlyph(0, 107, 132, 96, 4, 14);
  79.         SetGlyph(0, 108, 144, 96, 1, 14);
  80.         SetGlyph(0, 109, 153, 96, 7, 14);
  81.         SetGlyph(0, 110, 168, 96, 4, 14);
  82.         SetGlyph(0, 111, 180, 96, 4, 14);
  83.         SetGlyph(0, 112, 8, 118, 4, 14);
  84.         SetGlyph(0, 113, 20, 118, 4, 14);
  85.         SetGlyph(0, 114, 32, 118, 3, 14);
  86.         SetGlyph(0, 115, 43, 118, 4, 14);
  87.         SetGlyph(0, 116, 55, 118, 3, 14);
  88.         SetGlyph(0, 117, 66, 118, 4, 14);
  89.         SetGlyph(0, 118, 78, 118, 4, 14);
  90.         SetGlyph(0, 119, 90, 118, 5, 14);
  91.         SetGlyph(0, 120, 103, 118, 4, 14);
  92.         SetGlyph(0, 121, 115, 118, 4, 14);
  93.         SetGlyph(0, 122, 127, 118, 3, 14);
  94.         SetGlyph(0, 123, 138, 118, 3, 14);
  95.         SetGlyph(0, 124, 149, 118, 1, 14);
  96.         SetGlyph(0, 125, 158, 118, 3, 14);
  97.         SetGlyph(0, 126, 169, 118, 4, 14);
  98.         SetGlyph(0, 161, 181, 118, 1, 14);
  99.         SetGlyph(0, 162, 8, 140, 4, 14);
  100.         SetGlyph(0, 163, 20, 140, 4, 14);
  101.         SetGlyph(0, 164, 32, 140, 5, 14);
  102.         SetGlyph(0, 165, 45, 140, 5, 14);
  103.         SetGlyph(0, 166, 58, 140, 1, 14);
  104.         SetGlyph(0, 167, 67, 140, 4, 14);
  105.         SetGlyph(0, 168, 79, 140, 3, 14);
  106.         SetGlyph(0, 169, 90, 140, 8, 14);
  107.         SetGlyph(0, 170, 106, 140, 3, 14);
  108.         SetGlyph(0, 171, 117, 140, 6, 14);
  109.         SetGlyph(0, 172, 131, 140, 3, 14);
  110.         SetGlyph(0, 173, 142, 140, 3, 14);
  111.         SetGlyph(0, 174, 153, 140, 8, 14);
  112.         SetGlyph(0, 175, 169, 140, 3, 14);
  113.         SetGlyph(0, 176, 180, 140, 3, 14);
  114.         SetGlyph(0, 177, 191, 140, 5, 14);
  115.         SetGlyph(0, 178, 8, 162, 3, 14);
  116.         SetGlyph(0, 179, 19, 162, 3, 14);
  117.         SetGlyph(0, 180, 30, 162, 2, 14);
  118.         SetGlyph(0, 181, 40, 162, 4, 14);
  119.         SetGlyph(0, 182, 52, 162, 5, 14);
  120.         SetGlyph(0, 183, 65, 162, 1, 14);
  121.         SetGlyph(0, 184, 74, 162, 2, 14);
  122.         SetGlyph(0, 185, 84, 162, 2, 14);
  123.         SetGlyph(0, 186, 94, 162, 3, 14);
  124.         SetGlyph(0, 187, 105, 162, 6, 14);
  125.         SetGlyph(0, 188, 119, 162, 9, 14);
  126.         SetGlyph(0, 189, 136, 162, 10, 14);
  127.         SetGlyph(0, 190, 154, 162, 10, 14);
  128.         SetGlyph(0, 191, 172, 162, 4, 14);
  129.         SetGlyph(0, 192, 184, 162, 4, 14);
  130.         SetGlyph(0, 193, 196, 162, 4, 14);
  131.         SetGlyph(0, 194, 8, 184, 4, 14);
  132.         SetGlyph(0, 195, 20, 184, 4, 14);
  133.         SetGlyph(0, 196, 32, 184, 4, 14);
  134.         SetGlyph(0, 197, 44, 184, 4, 14);
  135.         SetGlyph(0, 198, 56, 184, 7, 14);
  136.         SetGlyph(0, 199, 71, 184, 4, 14);
  137.         SetGlyph(0, 200, 83, 184, 4, 14);
  138.         SetGlyph(0, 201, 95, 184, 4, 14);
  139.         SetGlyph(0, 202, 107, 184, 4, 14);
  140.         SetGlyph(0, 203, 119, 184, 4, 14);
  141.         SetGlyph(0, 204, 131, 184, 2, 14);
  142.         SetGlyph(0, 205, 141, 184, 2, 14);
  143.         SetGlyph(0, 206, 151, 184, 3, 14);
  144.         SetGlyph(0, 207, 162, 184, 3, 14);
  145.         SetGlyph(0, 208, 173, 184, 5, 14);
  146.         SetGlyph(0, 209, 186, 184, 5, 14);
  147.         SetGlyph(0, 210, 8, 206, 4, 14);
  148.         SetGlyph(0, 211, 20, 206, 4, 14);
  149.         SetGlyph(0, 212, 32, 206, 4, 14);
  150.         SetGlyph(0, 213, 44, 206, 4, 14);
  151.         SetGlyph(0, 214, 56, 206, 4, 14);
  152.         SetGlyph(0, 215, 68, 206, 5, 14);
  153.         SetGlyph(0, 216, 81, 206, 5, 14);
  154.         SetGlyph(0, 217, 94, 206, 4, 14);
  155.         SetGlyph(0, 218, 106, 206, 4, 14);
  156.         SetGlyph(0, 219, 118, 206, 4, 14);
  157.         SetGlyph(0, 220, 130, 206, 4, 14);
  158.         SetGlyph(0, 221, 142, 206, 5, 14);
  159.         SetGlyph(0, 222, 155, 206, 4, 14);
  160.         SetGlyph(0, 223, 167, 206, 4, 14);
  161.         SetGlyph(0, 224, 179, 206, 4, 14);
  162.         SetGlyph(0, 225, 191, 206, 4, 14);
  163.         SetGlyph(0, 226, 8, 228, 4, 14);
  164.         SetGlyph(0, 227, 20, 228, 4, 14);
  165.         SetGlyph(0, 228, 32, 228, 4, 14);
  166.         SetGlyph(0, 229, 44, 228, 4, 14);
  167.         SetGlyph(0, 230, 56, 228, 7, 14);
  168.         SetGlyph(0, 231, 71, 228, 4, 14);
  169.         SetGlyph(0, 232, 83, 228, 4, 14);
  170.         SetGlyph(0, 233, 95, 228, 4, 14);
  171.         SetGlyph(0, 234, 107, 228, 4, 14);
  172.         SetGlyph(0, 235, 119, 228, 4, 14);
  173.         SetGlyph(0, 236, 131, 228, 2, 14);
  174.         SetGlyph(0, 237, 141, 228, 2, 14);
  175.         SetGlyph(0, 238, 151, 228, 3, 14);
  176.         SetGlyph(0, 239, 162, 228, 3, 14);
  177.         SetGlyph(0, 240, 173, 228, 4, 14);
  178.         SetGlyph(0, 241, 185, 228, 4, 14);
  179.         SetGlyph(0, 242, 8, 250, 4, 14);
  180.         SetGlyph(0, 243, 20, 250, 4, 14);
  181.         SetGlyph(0, 244, 32, 250, 4, 14);
  182.         SetGlyph(0, 245, 44, 250, 4, 14);
  183.         SetGlyph(0, 246, 56, 250, 4, 14);
  184.         SetGlyph(0, 247, 68, 250, 5, 14);
  185.         SetGlyph(0, 248, 81, 250, 5, 14);
  186.         SetGlyph(0, 249, 94, 250, 4, 14);
  187.         SetGlyph(0, 250, 106, 250, 4, 14);
  188.         SetGlyph(0, 251, 118, 250, 4, 14);
  189.         SetGlyph(0, 252, 130, 250, 4, 14);
  190.         SetGlyph(0, 253, 142, 250, 4, 14);
  191.         SetGlyph(0, 254, 154, 250, 4, 14);
  192.         SetGlyph(0, 255, 166, 250, 4, 14);
  193. }
« Last Edit: 29 Oct 2013, 16:24 by Daniel Eakins »
We all have our time machines, don't we?

Calin Leafshade

  • AGS Project Tracker Admins
  • Long live King Cat!
    • I can help with making music
    •  
    • I can help with voice acting
    •  
    • Calin Leafshade worked on a game that was nominated for an AGS Award!
      Calin Leafshade worked on a game that won an AGS Award!
Re: Another Plugin: SpriteFont Renderer. Native Bitmap Fonts.
« Reply #68 on: 29 Oct 2013, 17:23 »
You load it as a sprite like any other sprite and then pass the sprite number to the SetGlyph function as the first parameter.

Daniel Eakins

  • Time Traveller
Re: Another Plugin: SpriteFont Renderer. Native Bitmap Fonts.
« Reply #69 on: 29 Oct 2013, 18:00 »
Oh right! :shocked: Thanks, it works now. This plugin is perfect for translations and support for 256-character fonts.
We all have our time machines, don't we?

JSH

  • Founder of Clifftop Games
    • JSH worked on a game that was nominated for an AGS Award!
      JSH worked on a game that won an AGS Award!
Re: Another Plugin: SpriteFont Renderer. Native Bitmap Fonts.
« Reply #70 on: 31 Oct 2013, 12:55 »
I must say this is an awesome plugin, pretty much the only way to get a flawless result in AGS regarding fonts. Great work Calin, gave you a spot in the credits :)

Ascovel

  • Mittens Serf
  • The eyes of Rooster Cockburn
    • I can help with story design
    •  
    • Ascovel worked on a game that was nominated for an AGS Award!
      Ascovel worked on a game that won an AGS Award!
Re: Another Plugin: SpriteFont Renderer. Native Bitmap Fonts.
« Reply #71 on: 04 Nov 2013, 21:15 »
Great plugin. Thanks, Calin!

Monsieur OUXX

  • Cavefish
  • Mittens Vassal
  • Mittens Half Initiate
    • I can help with proof reading
    •  
    • I can help with translating
    •  
    • I can help with voice acting
    •  
Re: Another Plugin: SpriteFont Renderer. Native Bitmap Fonts.
« Reply #72 on: 14 Nov 2013, 20:55 »
More detailed guidelines, courtesy of Daniel Eakins :

Quote
1) Once you have downloaded Calin's plugin, you have to launch "SpriteFont.exe". This is program will create two files: "Texture.png" and "Metrics.xml". Make sure you select the ranges of characters that you want to include in your future font (in the cart icon):

2) In AGS, activate AGSSpriteFont in the Plugins icon in the right panel.
3) Import "Texture.png" as a sprite.
4) In function game_start(), type a SetVariableSpriteFont(AAA, BBB) command (where AAA is the font slot you want to use, such as 0, and BBB is the number of the sprite you have just imported).
5) Launch "AGSSpriteFontGen.exe" and open "Metrics.xml" in it to get some AGS coding. Paste that coding in function game_start() after the SetVariableSpriteFont command.

That's all, that should work. The best thing about this plugin is that you can open "Texture.png" in any image editor if you want to edit the font pixel by pixel. Also check Calin's first post in his thread to understand what the coding you get from "AGSSpriteFontGen.exe" means if you want to also edit that.



Also, for all those interested in multilingual fonts, this page could come handy : http://www.adventuregamestudio.co.uk/wiki/Fonts
 

Re: Another Plugin: SpriteFont Renderer. Native Bitmap Fonts.
« Reply #73 on: 03 Jan 2014, 06:23 »
How do I apply a tint to a sprite font? I read in a previous reply that tinting was implemented, but changing the font colour of my labels doesn't seem to do anything. Am I doing it wrong?

Edit: I also ran into the new line bug when not all of my characters were defined. Here's a suggestion: have SetVariableSpriteFont take a height parameter to use as the default height when some characters are used but not defined. It would make building and testing incomplete fonts a bit easier. That said, variable heights seem to inconsistently alter the line height anyway, so maybe it'd be an idea to remove that parameter from SetGlyph.
« Last Edit: 03 Jan 2014, 11:48 by Gurok2 »

Calin Leafshade

  • AGS Project Tracker Admins
  • Long live King Cat!
    • I can help with making music
    •  
    • I can help with voice acting
    •  
    • Calin Leafshade worked on a game that was nominated for an AGS Award!
      Calin Leafshade worked on a game that won an AGS Award!
Re: Another Plugin: SpriteFont Renderer. Native Bitmap Fonts.
« Reply #74 on: 03 Jan 2014, 23:47 »
Tinting should be automatic and follow the label color. Tinting is multiplicative not additive so white = your tint color, black = black.

As for the line height, yea youre right that it probably doesnt handle it very well. I'll consider changing for the next version (which will be OOP)

Gurok

  • Rottwheelers
  • When life hands you lemons, combine them with the mop
    • I can help with AGS tutoring
    •  
    • Best Innovation Award Winner 2016, for improving and extending the AGS scripting language
    •  
    • I can help with proof reading
    •  
    • I can help with scripting
    •  
    • Gurok worked on a game that was nominated for an AGS Award!
      Gurok worked on a game that won an AGS Award!
Re: Another Plugin: SpriteFont Renderer. Native Bitmap Fonts.
« Reply #75 on: 04 Jan 2014, 02:06 »
Thanks Calin! The white/black thing sent me in the right direction. Importantly, I found you must also use the file from page 3 of this thread. The file in the original post has not been updated to support tinting.

Gurok

  • Rottwheelers
  • When life hands you lemons, combine them with the mop
    • I can help with AGS tutoring
    •  
    • Best Innovation Award Winner 2016, for improving and extending the AGS scripting language
    •  
    • I can help with proof reading
    •  
    • I can help with scripting
    •  
    • Gurok worked on a game that was nominated for an AGS Award!
      Gurok worked on a game that won an AGS Award!
Re: Another Plugin: SpriteFont Renderer. Native Bitmap Fonts.
« Reply #76 on: 05 Jan 2014, 16:56 »
I have a 9 pixel high font with 1 pixel of spacing. In GUI windows, the spacing looks correct. In Text windows, however, the vertical spacing appears to be ignored. GetTextHeight also returns 18 for two lines of text. I'm thinking there's some bug with sprite fonts and text windows, but it's also possible I've overlooked something. Any ideas?

« Last Edit: 05 Jan 2014, 17:01 by Gurok »

Calin Leafshade

  • AGS Project Tracker Admins
  • Long live King Cat!
    • I can help with making music
    •  
    • I can help with voice acting
    •  
    • Calin Leafshade worked on a game that was nominated for an AGS Award!
      Calin Leafshade worked on a game that won an AGS Award!
Re: Another Plugin: SpriteFont Renderer. Native Bitmap Fonts.
« Reply #77 on: 05 Jan 2014, 20:25 »
The rendering should be same either way from the plugins point of view. I will investigate.

Gurok

  • Rottwheelers
  • When life hands you lemons, combine them with the mop
    • I can help with AGS tutoring
    •  
    • Best Innovation Award Winner 2016, for improving and extending the AGS scripting language
    •  
    • I can help with proof reading
    •  
    • I can help with scripting
    •  
    • Gurok worked on a game that was nominated for an AGS Award!
      Gurok worked on a game that won an AGS Award!
Re: Another Plugin: SpriteFont Renderer. Native Bitmap Fonts.
« Reply #78 on: 26 Jan 2014, 13:35 »
Any luck on that text v/s GUI line spacing issue, Calin?

Gurok

  • Rottwheelers
  • When life hands you lemons, combine them with the mop
    • I can help with AGS tutoring
    •  
    • Best Innovation Award Winner 2016, for improving and extending the AGS scripting language
    •  
    • I can help with proof reading
    •  
    • I can help with scripting
    •  
    • Gurok worked on a game that was nominated for an AGS Award!
      Gurok worked on a game that won an AGS Award!
Re: Another Plugin: SpriteFont Renderer. Native Bitmap Fonts.
« Reply #79 on: 27 Mar 2014, 13:54 »
I have worked out what this is, Calin.

From line 229 of graphics_mode.cpp, labels use this value for font height:

usetup.textheight = wgetfontheight(0) + 1;

And regular fonts in text window GUIs use this value for font height (display.cpp, line 94):

texthit = wgetfontheight(usingfont);

I am not sure what the best course of action is here. Breaking font height handling in labels would probably break legacy code.

The ideal would be for both to use wgetfontheight(n) + line_spacing, but that would require some kind of switch between legacy<-->rational mode.

For now, I might have to stick to single line descriptions in GUIs and just add 1 to the overall font height.

Crimson Wizard

  • AGS Project Tracker Admins
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    •  
    • Lifetime Achievement Award Winner
    •  
Re: Another Plugin: SpriteFont Renderer. Native Bitmap Fonts.
« Reply #80 on: 27 Mar 2014, 14:00 »
I am not sure what the best course of action is here. Breaking font height handling in labels would probably break legacy code.
<...>
The ideal would be for both to use wgetfontheight(n) + line_spacing, but that would require some kind of switch between legacy<-->rational mode.
There are simple ways to deal with compatibility, that's what I explained in regards to your very first pull request - checking game data version.
(Or against GUI version - if you were adding new properties to gui class)
In this case there may be a global variable (well, "global" by scope of applicance, not in C meaning) that defines message spacing, 0 for old games and 1 (or settable) for new ones.

Also I don't think GUI should use this usetup.textheight. Looking at its usage in code - it appears to be a very old legacy way to define text height, and it is used mostly in "built-in" dialogs. The only "new" gui using it is GUILabel. Maybe it was "forgotten" there.

EDIT: Wait... I've got confused myself. On more close examination, labels do not use usetup.textheight. They calculate their line height as
Code: C++
  1. TEXT_HT = wgettextheight("ZhypjIHQFb", font) + 1;
  2.  
The source of confusion is that TEXT_HT is also a macro defined as "usetup.textheight", but that macro is declared only for old built-in dialogs. And, there's a second set of control classes that are created on built-in dialogs, including label (MyLabel)
« Last Edit: 27 Mar 2014, 16:52 by Crimson Wizard »

Gurok

  • Rottwheelers
  • When life hands you lemons, combine them with the mop
    • I can help with AGS tutoring
    •  
    • Best Innovation Award Winner 2016, for improving and extending the AGS scripting language
    •  
    • I can help with proof reading
    •  
    • I can help with scripting
    •  
    • Gurok worked on a game that was nominated for an AGS Award!
      Gurok worked on a game that won an AGS Award!
Re: Another Plugin: SpriteFont Renderer. Native Bitmap Fonts.
« Reply #81 on: 27 Mar 2014, 23:09 »
I am not sure what the best course of action is here. Breaking font height handling in labels would probably break legacy code.
<...>
The ideal would be for both to use wgetfontheight(n) + line_spacing, but that would require some kind of switch between legacy<-->rational mode.
There are simple ways to deal with compatibility, that's what I explained in regards to your very first pull request - checking game data version.
(Or against GUI version - if you were adding new properties to gui class)
In this case there may be a global variable (well, "global" by scope of applicance, not in C meaning) that defines message spacing, 0 for old games and 1 (or settable) for new ones.

Well, yeah, checking against the game data version or the GUI version is what I wanted to avoid, as that would provide no way for people to obtain the legacy behaviour when compiling in a new version of AGS. I wanted to ensure things wouldn't break for people with old projects.

I think your second suggestion is probably the way to go if I understand it correctly. e.g.:

Code: Adventure Game Studio
  1. game.use_global_line_spacing = true;
  2. game.global_line_spacing = 1;

And in the default game template, we could just define:

Code: Adventure Game Studio
  1. game.use_global_line_spacing = true;

Thus preserving old behaviour for people upgrading to 3.3.1 (or whatever). I'm sorry. I didn't mean to give you the impression that I wasn't taking note when you told me about checking against game versions. I just meant that it wasn't straightforward and I wanted to avoid complicating the API where possible. For instance, I think defining a number like:

Code: Adventure Game Studio
  1. game.message_line_spacing = 0;

Might be too much because then game authors would need knowledge of how message spacing works (message_line_spacing + global_line_spacing = actual_line_spacing).
Quote

EDIT: Wait... I've got confused myself. On more close examination, labels do not use usetup.textheight. They calculate their line height as
Code: C++
  1. TEXT_HT = wgettextheight("ZhypjIHQFb", font) + 1;
  2.  
The source of confusion is that TEXT_HT is also a macro defined as "usetup.textheight", but that macro is declared only for old built-in dialogs. And, there's a second set of control classes that are created on built-in dialogs, including label (MyLabel)

Yes, sorry about that. I did get confused. I ended up looking at MyLabel last night because I think I just jumped to the first label definition I found. The principle is the same for both though. That pesky +1. I need to stop and consider things a bit more before I post sometimes though.
« Last Edit: 27 Mar 2014, 23:13 by Gurok »

Crimson Wizard

  • AGS Project Tracker Admins
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    •  
    • Lifetime Achievement Award Winner
    •  
Re: Another Plugin: SpriteFont Renderer. Native Bitmap Fonts.
« Reply #82 on: 27 Mar 2014, 23:16 »
I am not sure I understand why you need two "spacings" and not just one for "message box". Are we talking about same problem? I've got an impression that you just needed extra spacing for Display box.


E: Uh, and I just realized that we are spamming this into Calin's plugin thread :tongue:
« Last Edit: 27 Mar 2014, 23:21 by Crimson Wizard »

Dropped Monocle Games

  • You can call me Sox
    • I can help with animation
    •  
    • I can help with backgrounds
    •  
    • I can help with characters
    •  
    • I can help with play testing
    •  
    • I can help with web design
    •  
    • Dropped Monocle Games worked on a game that was nominated for an AGS Award!
Re: Another Plugin: SpriteFont Renderer. Native Bitmap Fonts.
« Reply #83 on: 21 Jan 2015, 19:59 »
Thanks Calin! The white/black thing sent me in the right direction. Importantly, I found you must also use the file from page 3 of this thread. The file in the original post has not been updated to support tinting.
Sorry to open this but I'm having a little problem,
The link on page 3 is broken and I'm using download from page 1


everything is working great apart from I can't seem to get tinting to work, should it work with .say and the colour set by the characters speech colour? if not is there a way for me to change colours for different characters speaking?
I have set my font sprite to be white with a black outline/shadow.
Really sorry if I have misunderstood this

Gurok

  • Rottwheelers
  • When life hands you lemons, combine them with the mop
    • I can help with AGS tutoring
    •  
    • Best Innovation Award Winner 2016, for improving and extending the AGS scripting language
    •  
    • I can help with proof reading
    •  
    • I can help with scripting
    •  
    • Gurok worked on a game that was nominated for an AGS Award!
      Gurok worked on a game that won an AGS Award!
Re: Another Plugin: SpriteFont Renderer. Native Bitmap Fonts.
« Reply #84 on: 22 Jan 2015, 10:43 »
Yes, all was broken for me too until I got the magic version. Here's the one I'm using, Soxbrooker:

http://goo.gl/5xo2v7

I believe it should use the character's speech colour, but I haven't tested that recently. I know that drawing to surfaces works, e.g.:

Code: Adventure Game Studio
  1. surface.DrawingColor = 14; // Set to yellow
  2. surface.DrawStringWrapped(1 + offset1, 1, widthMax - 1, font1, align, text1); // Draw some text in yellow
« Last Edit: 22 Jan 2015, 10:45 by Gurok »

Dropped Monocle Games

  • You can call me Sox
    • I can help with animation
    •  
    • I can help with backgrounds
    •  
    • I can help with characters
    •  
    • I can help with play testing
    •  
    • I can help with web design
    •  
    • Dropped Monocle Games worked on a game that was nominated for an AGS Award!
Re: Another Plugin: SpriteFont Renderer. Native Bitmap Fonts.
« Reply #85 on: 22 Jan 2015, 18:09 »
Awesome yeah, that worked great! Thank you :D

Re: Another Plugin: SpriteFont Renderer. Native Bitmap Fonts.
« Reply #86 on: 06 Apr 2015, 15:28 »
I am very interested in this plugin and the tool "Spritefont.exe". It seems that almost all download links are broken. Does anyone have a copy that he/she wishes to share?

Re: Another Plugin: SpriteFont Renderer. Native Bitmap Fonts.
« Reply #87 on: 09 Apr 2015, 21:30 »
Well, I did some carefull digging and found the sources at:

https://github.com/CalinLeafshade/ags-spritefont

So I fired up visual studio and recompiled all. Als I've found the original spritefont tool, so added this to the package at all.

It is working in my AGS game, so grab your binaries here:
https://dl.dropboxusercontent.com/u/20918686/ags/ags_sprtitefont.zip

Monsieur OUXX

  • Cavefish
  • Mittens Vassal
  • Mittens Half Initiate
    • I can help with proof reading
    •  
    • I can help with translating
    •  
    • I can help with voice acting
    •  
Re: Another Plugin: SpriteFont Renderer. Native Bitmap Fonts.
« Reply #88 on: 10 Apr 2015, 10:17 »
thanks a lot nims! Broken links are always a pain.
 

JSH

  • Founder of Clifftop Games
    • JSH worked on a game that was nominated for an AGS Award!
      JSH worked on a game that won an AGS Award!
Re: Another Plugin: SpriteFont Renderer. Native Bitmap Fonts.
« Reply #89 on: 10 Sep 2015, 11:19 »
Hey Calin, it looks like the source on github wasn't updated after the tinting fix. Would it be possible to have that uploaded? :)
« Last Edit: 10 Sep 2015, 11:32 by JSH »

Re: Another Plugin: SpriteFont Renderer. Native Bitmap Fonts.
« Reply #90 on: 19 Dec 2017, 16:18 »
Sorry to dig this up

Does anyone have a working link to a compiled version

Thanks