Fade font colour of previous location

OurJud
I'm creating a horror adventure using the Game Book mode (text adventure mode is proving too complicated for me).

Anyway, I have a black background with light grey text, and would like to fade the text of the previous location, so that the new location is more obvious to the reader.

I read a similar question and the asker was provided with a block of script which gave the desired effect, but I do not know how and where I add these scripts.

Any and all help much appreciated.

OurJud
Hi, Jay, some time back, you provided the following JavaScript which faded the font of the previous location.

jaynabonne wrote:Here is a screen capture of what it looks like in the GUI editor. I'm not sure that's any easier, but...

dimgbdiv.png
The text on the two lines is:

eval ("$('div[id^=\"divOutputAlign\"]').css('opacity', '0.5');")

and

eval ("getCurrentDiv().css('opacity', '1.0');")



Could this be amended - without too much work for yourself - to include the player's input too?

So that on return, instead of:

-----------------------------------

You are in a room. There are exits to the east and to the north.

>north
You are by a lake...

-----------------------------------

It would be:

----------------------------------

You are in a room. There are exits to the east and to the north.

>north

You are by a lake.
-----------------------------------

jaynabonne
Not easily, no. The echo of the player command is in the same div as the output from that command, so you'd have to search through the spans to find the right one to gray out. I'm not saying it's impossible. It just won't be a one or two line change.

jaynabonne
Actually (and it's funny how as soon as I stop thinking along one line, another line sometimes opens up), you can do it by pre-graying the command echo up front instead of trying to find it afterwards. Attached is a library that has both the user-input echo graying as well as the turnscript that grays the text for the last output (so you don't need to put it in your game).

Copy the library to your game folder and then go into your game and add it in (under "Advanced" / "Included Libraries"). Click Add, then select the library from the dropdown list. The code will be hooked in automatically.

(Note: I had to zip it. For some reason, the web site was rejecting it in its pure aslx form. So you'll have to unzip it to use it.)

OurJud
Thanks! :)

Works lovely.

I HAVE to force myself to get working on this now, or I'll never get it finished. Enough 'putting off' by busying myself with aesthetics.

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

Support

Forums