Change colour of player input

I’m sure there is a simple answer to this, but for the life of my I can’t find it … I want to change the colour of the player’s input. I’ve included Glulx Text Effects by Emily Short and amended the table of user styles thus:

Table of User Styles (continued)
style name font weight color
input-style regular-weight “#880000
special-style-2 bold-weight “#880088

but that doesn’t have any effect on the colour of the player’s input, presumably because I need to explicitly call it in some way, but how? I’m probably missing something very obvious, but searching the documentation, and the forums here doesn’t seem to give me any clue, so any help would be gratefully received.

Hm. The bold doesn’t seem, well, bold, but this is how you can invoke it just before and then change it back after the player types a command:

When play begins: 
	now the command prompt is ">[special-style-2]".

After reading a command:
	say "[roman type]".
1 Like

I think different interpreters have different behaviours. While all should apply this colour to finished inputs, I’m pretty sure Gargoyle doesn’t use it for active inputs, and instead it applies a colour from the config file. You can modify that in a config file which you can distribute along with the gamefile. Other interpreters may be similar.

1 Like

The original idea (in Glulx) was that live input should have the same typographic appearance as a completed input line – they both have the Input style. However, an interpreter can choose to highlight the input line for reasons of accessibility or approachability; that includes applying a user-defined special appearance.

This won’t work in Glulx because the interpreter sets the input line to some style. You have to chance the appearance of the Input style.

Thanks for the various suggestions. What did seem to work was a variation on Bad Parser’s code:

When play begins: 
	now the command prompt is "[input style]>".

After reading a command:
	say "[roman type]".

Putting the command prompt first just produced the default style, but changing the order seemed to work, at least in the Windows IDE, and as long as you don’t mind having the command prompt displayed in the same style as the player’s input.

I realise it may not work in all interpreters, but I guess I’ll worry about that when I have the game ready for testing.

1 Like