Hi!
I'm here with another problem to solve -
In my game, there is an event where the player transfers from one area to another (That's the most vague I can be to prevent spoilers) When that happens, I'd like the text color and the background image to change. Inserting an image just inserts an image on the actual game area with the text and not the background margins. Is there a way to change it so that the background image on the sides of the screen can be altered?
Thanks for helping!
// Changing foreground / background color. (Hex works too)
SetForegroundColour ("Black")
// (if you want to change your font color in general, use this.)
SetBackgroundColour ("Red")
// Changing FONT (and size) in game.
SetFontName ("'Courier New', Courier, monospace")
SetWebFontName ("Special Elite")
SetFontSize (12)
// Background image
There's more ways than one but the one I have found most reliable is using CSS.
div#gameBorder {
background-attachment: fixed !important;
background-image: url("http://url/pic.png") !important;
width: auto !important;
}
(I have lots of stuff in the #gameBorder div but I removed the stuff that doesn't have anything to do with the background image for easier reading.)
Hope this helps.
Thanks so much!
Is there a way to change the font color in-game instead of just in general? (I'm utterly hopeless at coding)
Also, where should I put the div#gameBorder code? I don't know CSS. ;w;
Also, I'm pretty sure my game is written in HTML, not CSS, so is there any way I can incorporate that into the HTML code?
This:
<font color=blue>This text will be blue</font>
<font color="#0000FF">This text will also be blue (but using the hexadecimal value)</font>
This text will be blue
This text will also be blue (but using the hexadecimal value)
Good luck =)
Oh. And to reply to this:
Is there a way to change the font color in-game instead of just in general?
This SetForegroundColour ("red")
will change the color on all text. You can use it whenever in the game and all text will change (even text that already was printed to the screen)
Use the font-tag (shown in previous post) if you want to change less than all text.
To change colour within a block of text, best way is with the text processor.
{color:blue:This text will be blue}
{colour:#0000FF:This text will also be blue (but using the hexadecimal value)}
Also, I'm pretty sure my game is written in HTML, not CSS, so is there any way I can incorporate that into the HTML code?
CSS is the preferred/modern way to tell a browser how the HTML should be displayed, so while your game outputs HTML, in the background the styling is in CSS.