Static text bar
phil570
28 Jan 2016, 18:49Is there anyway to make a Static text bar similar to the Command link bar?
http://forum.textadventures.co.uk/viewtopic.php?f=18&t=4681&p=30866&hilit=bottom+bar&sid=5b8b89ca5a28f1c6b2765fb66cdeec54#p30866
I want some of my text to be changeable on the fly, but not scroll up with everything else.
Pretty new to scripting so be gentle.
http://forum.textadventures.co.uk/viewtopic.php?f=18&t=4681&p=30866&hilit=bottom+bar&sid=5b8b89ca5a28f1c6b2765fb66cdeec54#p30866
I want some of my text to be changeable on the fly, but not scroll up with everything else.
Pretty new to scripting so be gentle.
The Pixie
29 Jan 2016, 09:01I have written a guide to changing the UI, and just added a post to do just this:
viewtopic.php?f=18&t=5111&p=41062#p41062
You might want to read the first and second posts first (but perhaps skip to "Using JavaScript"), as they give some background, and the new post does assume some knowledge of these things.
viewtopic.php?f=18&t=5111&p=41062#p41062
You might want to read the first and second posts first (but perhaps skip to "Using JavaScript"), as they give some background, and the new post does assume some knowledge of these things.
phil570
29 Jan 2016, 17:54This is great thank you. I was wondering how you did that when I was playing deeper.
I got it to show up but when I try to run the unpdatestatus script I get the following error:
Error running script: Error compiling expression '"$('#status_div').html('" + s + "');"': Unknown object or variable 's'
Do I need to change the script for the variable?
I got it to show up but when I try to run the unpdatestatus script I get the following error:
Error running script: Error compiling expression '"$('#status_div').html('" + s + "');"': Unknown object or variable 's'
Do I need to change the script for the variable?
The Pixie
29 Jan 2016, 18:20Yes, you need to set s to some value. Perhaps:
s = "Hits: " + player.hits + "<br/>Gold: " + player.gold
JS.eval("$('#status_div').html('" + s + "');")
s = "Hits: " + player.hits + "<br/>Gold: " + player.gold
JS.eval("$('#status_div').html('" + s + "');")
phil570
29 Jan 2016, 23:39OK got everything working.
Thanks for all the help.
Thanks for all the help.
phil570
01 Feb 2016, 03:20The Pixie wrote:Yes, you need to set s to some value. Perhaps:
s = "Hits: " + player.hits + "<br/>Gold: " + player.gold
JS.eval("$('#status_div').html('" + s + "');")
One more question how would I put a small character face picture above their stats?
If that is possible.
The Pixie
01 Feb 2016, 08:11I have not tried it, but you should be able to use the <img> html tag to put in an image. See here for how:
viewtopic.php?f=18&t=5566
viewtopic.php?f=18&t=5566