Background color

So I don’t see a way to change the background color in Inform 7. Is there one? And is there a way to change color/formatting of all the text after a certain point? I want the game to switch between being white on a black background to black on a white background partway through.

You’ll need the Glulx Text Effects extension to change text colors, and Flexible Windows to change the background color. However, in Glulx, once a window has been opened, any changes to its style hints will only take effect after the window has been closed and reopened (in other words, stylehints are applied when the window is opened). The main window, which I presume is the window you want to change, is difficult to close and reopen it during play. But you could potentially use Text Window Input-Output Control to use a window other than gg_mainwin as your game’s “main window”.

–Erik

I’m pretty sure there was a way to change at least just the text colours before Glulx came along – wasn’t there? Specifically I recall a zcode version of Photopia that had coloured text…?

Paul.

Was the OP asking about z-code? I no longer assume that people are asking about z-code if they don’t specify. In my mind at least, we’ve turned the glulx corner…

Basic Screen Effects lets you change both text color and background color, for z-code only. Z-code is more flexible than glulx in terms of changing colors, but has a very limited palette (good enough for the OP’s purposes, it sounds like).

–Erik

While I7’s default is for Z-code we should probably assume that’s what people are using.

The number of glulx questions posted here and the ever-increasing difficulty of fitting an I7 game into z-code suggest otherwise to me (there’s a thread current on raif likening writing a z5 game in I7 to “constrained design”), but I’ll try to remember that there are indeed people out there writing I7 games for z-code :wink:

–Erik

I am on Glulx; I have pictures as well.

But it sounds like these changes are more trouble than they’re worth.

I have no clue which VM people expect by default. I was just curious how much of this stuff (text colour, bg colour, etc.) is possible in zcode. As I am aiming for browser-based play with one of my projects I’ve been thinking it might be best for me to avoid using Glulx-level resources on that one at least, for performance reasons.

Paul.

Paul: yeah, sorry about that. I was trying to glance playfully at my own glulx solipsism (if you look at my listing in the extensions library, there are something like 20 extensions there, and maybe one of them works with z-code!) It didn’t come off that way, though…

You’re right about Photopia and colors in the z-machine. And actually, the glulx trick I mentioned (closing windows and reopening them with new stylehints) is how Adam Cadre ported Photopia to Glulx later. So that one game serves as an example for both platforms, in fact.

–Erik