ID:31942
 
A BYONDscape Classic!

"Z-Tips" debuts with some handy pointers on how to customize the appearance of your text--and better yet, "Z's Peeves" tells you how not to!

--Gughunter



by Zilal

This column showcases how to code small features new BYONDers are often eager to implement in their games, but may not know how. Today's tip is on how to alter the background and text colors in your game, like I do in my game Lexiconomy.



You alter text and background color by changing the client/script variable. The code that's going to go into that variable is in the CSS language, or Cascading Style Sheet, and it's becoming popular in web design these days. (It's what allows those links that change color or get underlined when you hover over them, for instance.) BYOND allows us to use a limited version of CSS.

Suppose I wanted to make a game with a navy blue background, big green text in the Lucida Console font, and yellow links. Here's my code:


client/script = "<STYLE> 
body {background: navy; color: green;
font-family: \"Lucida Console\"; font-size: 12pt}
.system {color: gray}
a:link {color: yellow}
a:visited {color: yellow}
a:active {color: yellow}
</STYLE>"


Now let's take a closer look at each part.

client/script = "<STYLE>


We're altering the client/script variable here.
I love this and hope it causes some people to change their blog colors to something easy to read.

Thank you.
Nice.
Good article. I had forgotten about the Z-tips.