Main window color and text color...

Yes I know about Basic Text Effects, but I think it’s a little unreasonable to have to code each and every line that is written that way, when really I just want to change ALL the text color… besides if I can’t change the background, what’s the point.

I would also like to change the main window color to black, for the duration of the game.

At the very least I would like to reverse out the colors of the main window screen.

I’m assuming my first step is changing the screen from null to color, but I do not know how to do that.

Any help would be GREATLY appreciated!!

I have googled for days and I have to say it looks like this is one of the biggest concerns that goes unanswered. I find it strange that this is not a built-in “preferences” option. It’s a pretty basic need.

Traditionally, the look of the main window has mostly been left to the player to decide. That doesn’t mean you can’t change the basic styles, it just means that most people don’t bother–the player will be able to override your decisions with most interpreters anyway. Here are some tips:

If you’re targeting one of the javascript interpreters, then you can use CSS to change the basic styles (z-code or Glulx). For desktop interpreters, you’ll need to change styles in-game. For Glulx, the Glulx Text Effects extension (built in) is what you need. (I’m afraid that I don’t know how to change these things in z-code.)

You might consider, though, whether what you want to do is wise. When you start to bring your own color choices to the overall look of the game, you open up the possibility to annoy people. This is especially the case for javascript interpreters, where it’s more difficult (though certainly not impossible) for the player to override your choices. As an example: Personally, I have no interest in reading light text on a black background for more than a few short lines. So, if you do that with your game, I probably won’t play it. Losing me as a player is no great shakes, but if other folks feel like I do (whether for clinical reasons or just personal preference), that wouldn’t be a good thing.

–Erik

I am using Zmpp2 (which I believe you pointed me towards - thank you again for your help with that!), which does not give a choice in changing the look. I have tried every known parameter tag name I can thing of, or find online for changing the background and font, to no avail.

If you know of another VM applet that interprets gluxe and lets you change the screen and text colors - I would happily try that. ( I am using old school 8-bit graphics, btw)

As for personal choice - I get that not everyone has the same likes (personally, the brightness of this site kills my eyes, less yet the stark white of inform7 games). The thing is, the game I am making is for a larger game (an arg), and it needs to fit in with the theme of that game, which is old school games. So, my HOPE is to be able to make the background a very dark gray or black and make the text green, like an old text adventure (or interactive fiction, if you prefer, I’m not sure if that is different or just another name for it, sorry).

I have written the designer of the VM to get the names of the parameter tags, but I highly doubt that I will hear back in time.

OK, if you’re using ZMPP it will be much easier to set these colors w/in the VM. Glulx Text Effects should let you do that, I think (at least by reversing out). If Glulx Text Effects doesn’t let you change the background color of the main-window, or you don’t want to use reversed type, you can include Flexible Windows:

Include Flexible Windows by Jon Ingold. After starting the virtual machine: now the back-colour of the main-window is g-black.

If you’re after the old-school terminal look, you might want to set the whole game in fixed-width fonts (again, Glulx Text Effects will do this for you)…

If not, post again and we can help you write the I6 calls you need.

–Erik

Thanks for your help!

Well, Zmpp-glulx totally ignored that code… Although, I did try something similar (but not with the “After starting the virtual machine”) before and got the background of JUST the text to change - like a highlighting type of effect. Is changing the color of the text even possible? If not, like I said, I will gladly accept a reversed-out look.

I am wondering how to call the “special-style-1” into effect for the whole game(if that’s possible). A “when play begins”? And after that what? - “set style-hints to special-style-1” doesn’t do the job… like I said, I’m a novice, sorry, if I am just being stupid about it.

Ok, I tested trying to use Text Effects, this is what I have:

[code]Table of User Styles (continued)
style name justification obliquity indentation first-line indentation boldness fixed width relative size glulx color
special-style-1 center-justified no-obliquity 0 0 regular-weight fixed-width-font 0 g-green
special-style-2 left-justified no-obliquity 0 4 regular-weight fixed-width-font 0 g-green

Table of Common Color Values (continued)
glulx color value assigned number
g-pure-green 65280

When play begins:
say "[second custom style]You are in a castle’s ward with 4 other people.[/code]
Then I compiled it and put it up on the server… it totally ignored the it. - Though when I ran it with Inform, it worked just fine.

I can’t tell you anything about ZMPP–maybe it doesn’t support all of the stylehints. You’ll probably want to go straight to the author about that.

Regarding special-style-1 and special-style-2, the idea isn’t that you would define them and then apply them to the whole text, it’s that you would redefine the built-in styles (bold, header, italics, etc.) See the code below for a working example.

Oddly, though, Glulx Text Effects actually doesn’t allow you to change the normal style–i.e., most of the text you read. I have no idea why that was left out, but I will try to include it for the next release of I7 (also left out are the background color and reversed-out stylehints–I assume these were left out to keep the table from getting too wide, but they really should also be included for completeness as well. Heck, I may even add support for changing styles in the status bar).

Anyway, for now, I’ve attached a new version of GTE that allows you to change the look of normal text. If you use this, the following code will work and do what you want. (Don’t forget to hack your copy of Flexible Windows to include “Glulx Text Effects - New” instead of plain “Glulx Text Effects”.)

[code]Include Glulx Text Effects - New by Emily Short.
Include Flexible Windows by Jon Ingold.

Table of User Styles (continued)
style name justification obliquity indentation first-line indentation boldness fixed width relative size glulx color
normal-style – -- – -- – fixed-width-font – g-lime
header-style – -- – -- bold-weight fixed-width-font – g-lime
bold-style – -- – -- bold-weight fixed-width-font – g-lime
input-style – -- – -- bold-weight fixed-width-font – g-lime

The back-colour of the main-window is g-black.

When play begins:
say “You are in a castle’s ward with 4 other people.”

There is a Room.[/code]

You’ll need to keep adding built-in styles to the table if you decide to use them–italic, for example, is not included here.

–Erik
Glulx Text Effects - New.txt (14.2 KB)

Thank you SO much Erik! I will definitely be working on that tomorrow(gotta sleep sometime :laughing: )!

Well, I have been at it, trying to implement the color changes with the hacked extension, but it keeps telling me it compiled just fine, but that I6 is throwing some errors…

Could you help me out with some code to reverse out the colors of the main-window?

Unless there have been changes in the latest versions of ZMPP, you can set the font and background color for the interpreter directly. The parameters are

<param name="defaultbg" value="black" /> <param name="defaultfg" value="white" />
These go inside the tags.

It looks like Juhana has a solution that should work for you. Given that ZMPP may not support stylehints, this might be the way to go.

That said, the code I posted works well and shouldn’t cause any errors. You can verify this by building it in a new project, without any of your game’s code. So the I6 errors you’re getting are generated by your game code–or your game code in interaction with Glulx Text Effects/Flexible Windows–and you’d need to solve them by tracking down the incompatibilities.

Here’s one idea: Depending on what other extensions you have installed, you might need to remove the reference to “Include Glulx Text Effects - New” from your story file. Since it’s already included in Flexible Windows, that inclusion is redundant. Inform can be a bit touchy about extension inclusions, though that touchiness usually results in I7 compiler errors rather than I6 ones.

Also, I’ve attached a modified version of Flexible Windows, which removes an issue that might have prevented the game from working in ZMPP (see Bug with Flexible Windows--or Quixe?). This version refers to Glulx Text Effects - New, rather than Glulx Text Effects.

–Erik
Flexible Windows - New.txt (56.5 KB)

Ok, I have your extension running great - all of the text color is green on the VM… the background is still white though!

Juhana’s suggested parameter names didn’t work, they must have been changed.

Hm, I’m not sure what to say about the white background. You don’t say what interpreter you’re using, but I see a black background in the interpreters I’ve tested with (Zoom, Gargoyle on OS X). Maybe try other interpreters to see if they’ve implemented background colors in text windows?

Also, you are using Flexible Windows, right? That’s what lets you set the window background.

–Erik

I am using zmpp-gluxe (also called zmpp2).

I have finally found a way to change the background… the only problem is that when the window first loads it is just a highlighted effect on text, but after the next window loads, the whole main window background turns black. I’m not sure how to change that, but what I put, that actually showed on the VM is:

The main-window is a text-buffer g-window. The back-colour of the main-window is g-black.

It’s some progress at least…

Can I ask why you’re using ZMPP and not Quixe or Parchment? Changing the colors in JavaScript interpreters would be trivial.

I am using graphics.

I’m surprised that the I7 compiler lets you declare the main-window a second time: That declaration (“The main-window is a text-buffer g-window”) is already present in Flexible Windows. I also don’t understand know how it could have helped things to have two window objects with the same name. I would recommend that you delete the first part and just leave “The back-colour of the main-window is g-black”.

If you clear the window once on your own at the outset, that should force the background color to show up in ZMPP, e.g.:

When play begins: clear the main-window.

–Erik

I think you are right that some of my previous coding was interacting badly. The help you have given me has been outstanding!
Finally, green text on a black background! :laughing:

Glad to hear you’ve got it working!

–Erik