How to use:

There are 3 types of tags you can use by default. Regular Spritefont tags, sfdx tags and typewriter tags. typewriter tags are written like this: [tw= ] and they don't need a closing tw tag. key can be any of {wait, pause, fade, type, fn} Wait and pause pause the typewriter, fade and type change how letters are typed.

[tw=fn function JSParams] will call a function when the typewriter reaches it, and it will pass some params to it. params are written in JS and delimited by commas. So this should be used like this

[tw=fn changeface 'smiling'] or [tw=fn createparticle 'explode', 150, 236]

sfdx tags are written like this: [sfdx= ]

tag can be any of the default spritefont tags, and the code is interpreted in JS.

I made some functions available from there like cos, sin, random, lerp, lerpColor, unlerp, lerpUnlerp, and lerpHexColor, and you can make your own function aliases and they'll be added to the list

Also in the js code you can use t for game time and i for current letter id for the animations So a wave animation will be something like

[sfdx=offsety 8*cos(t * 300 + i * 90)]my wavy text[/sfdx]

And when defining an alias you can define additionnal params for your alias function (on top of t and i) and you can use the params in the code

cdn.discordapp.com/attachments/311108993739390976/584820916710670357/-MsyOAiL.png

cdn.discordapp.com/attachments/311108993739390976/584820994133196813/MGMjrp-T.png

Another feature is the use of dictionnary for values.

You can link a dictionary to SFDX and then these tags become available:

[var=name] gets a string of any length from the dictionary and sets it once (this won't update).

[varfn=function] calls function and replaces with whatever it returns (same this won't update).

[text=name X] This will tell SFDX to reserve X characters for a key in the dictionnary and they will update on every frame. If the dictionnary's string is shorter or longer, the text will be trimmed, or completed with empty spaces.

[fn=function X] Again, this will tell SFDX to reserve X characters for a value returned by a function and they will update on every frame. If the function's return string is shorter or longer, the text will be trimmed, or completed with empty spaces.

Note: because this is a string and is subject to be used with uppercase() and lowercase(), every tag and data is lowercased for safety, so don't use keys with majs in them in the dictionnary or you won't be able to access them!

Note 2: This is not the case with functions. For some reason, functions are lowercased at runtime too, so you can not care a single bit, it will work as intended.

Download

1.0.1.2 Stable (19.54 KB)

Info

  • License MIT License
  • Copyright Ossama Jouini. All rights reserved.

Statistics

  • Download count568 total downloads
  • Latest download count 237 downloads of latest version
  • Average download count2 downloads per day average

Owners

  • 17 Comments

  • Order by
Want to leave a comment? Login or Register an account!
  • This didn't work for me either. I tried to copy and paste the examples, but nothing happened.

  • Does anyone actually use this plugin in their code? I paid for the Construct 2 version, and am disappointed that this C3 one is so convoluted compared to the C2 one.

    It's been almost half a year since I asked for an example of how to even use the plugin :(

    • Hi, sorry for the very late reply. I have been terribly busy lately, but I finally managed to get an example thanks to the amazing work of Mateus.

      He made the example and provided it to me so I could share it here for free :).

  • Sorry to pester, but is there any update toward that example c3p I requested a couple months back? I'm using C3's [color=rgb(0,255,0)] forumla, and it's vile compared to SFD's elegant "C green" I used in Construct 2.

  • I don't suppose it's possible for your plugin to add those extra features to the debug, is there? Such as the scale, spacing, etc. I used this all the time in C2 to get the font looking how I wanted, but Construct's base SpriteFont seems to be very limited compared to what you had made.

  • Any chance we can get an example c3p so we can see how to change colours easily?

  • What are all the functions?

    • Because in the old version there were some interesting ones like <A swing> or the <tw wait> but those don't work anymore and there aren't in the documentation

      • Hi, this plugin is a bit more complex than the C2 one. Instead of providing premade functions, it allows you to define your own.

        For instance [sfdx=offsety 8*cos(t * 300 + i * 90)]my wavy text[/sfdx] will do a wavy text.

        However, angle doesn't work as the default spritefont object doesn't support an angle tag yet :(

        Load more comments (2 replies)
  • This seems really really amazing! However ... is there any working example of how to make it work? Perhaps its just me, but really could not get to make any of these features work ...