Changing Margin Color and Pane Theme (Solved)

Io

So at one point in my game, I want to change the color of the screen via code. However, the simple 'change background change foreground' stuff doesn't work for me. What I want is code that will change the color of the text, the color of the background, AND the color of the margins, AND change the style of the panes from one to another ingame.

I can get half of these to work. I can make the background and foreground - text color - change to the right stuff. But the margins don't change - they stay white, and I made sure that Color Blend For Background is off - and the panes don't change - they don't go from Classic to Midnight.

The code I tried for those was:

game.marginscolour="Black"
game.panestheme="Midnight"

But it did nothing. Please advise.


SetBackgroundColour(string colour)

See here
http://docs.textadventures.co.uk/quest/scripts/request.html


Io

No, that's not the problem. SetBackGroundColour is what I'm using, and it works, but I'm also trying to set the margin color.

At any rate I just found what I was looking for for that:

JS.setCss("body","background:black")

However, now I still cannot find how to change the Pane Theme in the middle of the game.


how about GameBorder. That is the middle pane
JS.setCss ("#gameBorder", "background:red")


Io

No, you're misunderstanding what I mean by 'pane'. I mean the thing on the side that hold your inventory, show objects in the room, and show the possible exits. I want to change it, midgame, from Classic Style to Midnight Style.


The general way to do this is, as Forgewright says, like this:

JS.setCss ("#gameBorder", "background:red")

You just need to find the right ID to replace "gameBorder". Take a look at the first part of this page; it explains how you can find it yourself:
http://docs.textadventures.co.uk/quest/ui-javascript2.html



Io

Hmm. As much as I'd normally be up to the challenge, it feels like too much effort considering what a tiny part of the game the Pane Changing would actually be. Thanks anyhow.


K.V.

I know this is marked "Solved", but I thought this might help anyway:


Create a function named ApplyPanesTheme with no parameters.

Put this for the script in code view (I stole this bit of code from the InitInterface function, just for the record's sake):

if (game.panestheme = "Midnight") {
  JS.setPanes ("white", "midnightblue", "midnightblue", "skyblue")
}
if (game.panestheme = "Nature") {
  JS.setPanes ("#A1C935", "#254117", "#306754", "#A1C935", "green")
}
if (game.panestheme = "Parchment") {
  JS.setPanes ("#493D26", "#FAEBD7", "#FAEBD7", "#493D26", "#C88141")
}
if (game.panestheme = "Vanilla") {
  JS.setPanes ("black", "white")
}
if (game.panestheme = "Black") {
  JS.setPanes ("orange", "black", "black", "orange")
}
if (game.panestheme = "Blood") {
  JS.setPanes ("orange", "#800000", "#800000", "orange", "yellow")
}
if (game.panestheme = "Tranquil") {
  JS.setPanes ("midnightblue", "skyblue", "white", "midnightblue", "blue")
}

Then, you can change the theme and apply the changes during play like so:

// Changing the theme to Midnight (just a random choice)
game.panestheme = "Midnight"
ApplyPanesTheme

Oh, yea


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

Support

Forums