Changing background colour back to blended

I had wanted to create an object that would change the background colour temporarily, but found there was no way to reset the screen which meant ruining a pretty blend. Is there any way to take down the background colour added in a game? Is there an option to change the "background colour to "clear" which would leave the blend visible on more than the margins? Is there a way to code in the original blend all over again to reset the colour of the game to what it started as, that could be attached to a verb like "reset screen" or "take down tinted screen"?


How are you setting CSS directly on some element, such as body or #gameBorder? If so, you should be able to remove it pretty easily:

JS.eval("$('body').removeAttr('style');")

This will remove all direct styles, causing the element to revert to whatever colour or pattern it is given by the stylesheet. (replacing body with whichever element you want to revert).


Thank you. I will give it a try. I had been using the not-code view Change Background to Colour ____.


So, hey. That did not work. It turned the entire background white, whereas I had started the game with a forest green to black blend. The problem I am trying to solve is a code to create the blended backgrounds, one for top (including margins), to be blended down, and one to be blended up from the bottom (including margins).
In GAME, in DISPLAY, half way down the page it says BACKGROUND. Under BACKGROUND, there is a box containing a list of possible "page colours" and to choose one you scroll. Under that, there is a box to tick "set page opacity". I have never ticked it. Beneath that, there is another box to tick "Colour blend for background?" I tick it. There are two scroll boxes when you tick it, one for "Colour at the top" and one for "Colour at the bottom". The blend is beautiful and does the full screen, including borders.
If I use the prewritten script during the game/story, to "change the background colour" I get a square of colour in the center of my screen that covers that part of the blend and, while it can be hidden by a different colour (or changed to another colour square), I have not been able to restore the uncovered colour blend to the center of the screen. I guess the closest I could get would be settling for blended borders, and choosing whatever colours I wanted to change the background square into, for each room, but I do not like being limited, and would love to not have that limitation.


OK; I think there is a built-in function called something like InitInterface or something like that.
If you're on the desktop editor, unhiding that function should let you look at its code and work out which bits you need to copy.

Alternatively, if you just call the InitInterface function (sorry if I got the name wrong, I'm answering from memory), it will do all the stuff that is done by default when a new game starts, including setting up the colours, showing/hiding panes, and similar tasks. However, this may have some unintended side effects, especially if your game includes custom javascript.


All that does not mean I don't appreciate the extra code for undressing the game, of course. Everything is useful at some point. And I certainly appreciate someone taking an interest in my need. (So thanks.)

Oh, I am just now seeing that you have replied again. That's fantastic for me. I will look into InitInterface!


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

Support

Forums