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.10 Stable (18.5 KB)

Info

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

Statistics

  • Download count 31 total downloads
  • Latest download count 31 downloads of latest version
  • Average download count 4 downloads per day average

Owners

  • 0 Comments

  • Order by
Want to leave a comment? Login or Register an account!