Inverting game colors and adding images?

I’m making a game for a game jam, and one of the requirements is a black and white color palette. I want to have a black background with white text, which I know is possible via an extension to inform, but it’s not compatible with adding images. Is there a way I can do both of these things at once?

So I assume the general problem you’re hitting is z-code doesn’t do images, and glulx doesn’t support native text coloring.

You will also have an issue depending on how you present the game. If the player plays in an standalone interpreter, it’s possible it will override all your color settings - though I don’t know if z-code has precedence on that.

One potential solution is to “release along with an interpreter and a website” in glulx for your images, handle the color scheme via the CSS, and distribute it as browser-only.

You can also do it in Vorple, but that requires that you host the build somehow (on a personal website, or one that will allow browser play such as itch.io.)

2 Likes

I was able to set up a black background, white text, and also display an image in Glulx, like this:

Include Glulx Text Effects by Emily Short.

Table of User Styles (continued)
style name	color	background color
normal-style	"#ffffff"	"#000000"

Lab is a room.

Figure 1 is the file "sample.jpg".

When play begins:
	display Figure 1.

My example here changes the regular text, but if you also want to make the room names white, I think you can do that with “bold-style.”

3 Likes

I can confirm this works. I just used it to produce white text on a black background for my Spring Thing submission. Just be aware that if you’re using Glimmr to provide graphics, some combinations of interpreters and player display resolutions can break the background around your graphics window and lead to white bars to each side of the graphic. Obviously, if you aren’t using Glimmr, don’t worry about it.

1 Like

Thank you! I was mistaken that text coloration was non-glulx only.

2 Likes

Where does that image need to be saved so that the game can get to it?

1 Like

§23.4. Gathering the figures

Inform provides basic support for displaying pictures and leaves more exotic effects for Extensions to provide. But either way, for reasons explained in the previous section, we can only have pictures if the Settings for the project are set to the Glulx story file format.

Inform calls these pictures “figures”, following the usual Inform analogy with books. We will think of our work of IF as being like a mostly textual book which in broken up with illustrations here and there - Figure 1, Figure 2, and so on. These might be used to mark each new chapter of the plot, or each new location: whatever the author would like. So the first thing we need to do is decide when pictures should appear.

The second thing to do is to get hold of the pictures we want to use. These might be photographs, or artwork, or diagrams: anything, really, but we will need them to be in either JPEG or PNG format. Inform does not itself try to be an image editor, or an artwork program - there are many such programs already which do these things much better than Inform could.

The pictures then need to be put in a special place where Inform can reach them. Suppose the Inform project is called Example.inform. Then we need to create a folder alongside it called “Example.materials”, and create a further folder inside that called “Figures”. The actual images go inside “Figures”. So we might then have files like so:

 Example.inform 
 Example.materials 
     Figures 
         Woodlands.png 
         Blackberry.jpg 
         Red Admiral Butterfly.png

The “.materials” folder for an Inform project will turn out to have many other uses in the chapter on Publishing, and will be explained further there.

1 Like

Thank you!

1 Like