Status Bar

Is there any way where you can code a status bar? Like you know it just like appears as a top margin that displays like the score and such.


Yes. Just create a div in the main html template and use CSS to style according. Look up some html css tutorials.

You'd then have to use Javascript to grab the data of your variables and print to the div. You could use something like :

var myprogress = squiffy.get("attributename");

And then use the standard:

document.getElementById("yourID").innerHTML = myprogress;

To output to a span container within the aforementioned div.

This is probably the hardest bit if you aren't familiar with Javascript but overall it's pretty straight forward stuff.

That said, using the above approach may cause issues for players resuming the game, as your changes to html elements won't be saved. That said, squiffys internal attribute states are saved, so a simple JS call could reload.


This topic is now closed. Topics are closed after 180 days of inactivity.

Support

Forums