Discussion:
[InfGlk Glulx] Change background color and styles
(too old to reply)
Urbatain
2004-05-25 17:43:08 UTC
Permalink
Hi: (sorry my bad english and such... I'm spanish)

I wonder how to change the background color in the main window.
I tried to set it and clear the main window but doesn't work, but
Photopía 2.02 does it succesfull.

Any help?

And... A more deep question. I'm trying to define two diferent sets of
styles in the same glulx game, but is evident that I cannot make it
between running the game because Gull says clearly that Glk put the
colors when intializing the windows, so if I define a new set of
styles by a prompt command, it won't work. I was thinking of possible
solutions:

1) To prompt the player at the beggining of the game "do you wanna set
1 or set 2", for example. But it will need to create a main window to
print and input the response, then destroy the main window, switch the
styles and let inform to initialize the set of windows. Could it work?

2) Make an action for switching... destroy all windows, switch style
and recreate them... all this in game. Could it work?

Thanks and see you!

El Clérigo Urbatain.
David Kinder
2004-05-25 18:23:33 UTC
Permalink
Post by Urbatain
Hi: (sorry my bad english and such... I'm spanish)
Well, it's a lot better than my Spanish :)
Post by Urbatain
I wonder how to change the background color in the main window.
I tried to set it and clear the main window but doesn't work, but
Photopía 2.02 does it succesfull.
In Windows Glulxe the background colour of the window is whatever the
background colour of the normal text style is when the window is opened.
That's how Adam does it, though it might not work with all Glulx/Glk
implementations.

Oh, and you've got to set the style *before* opening the main window.
Once the window is open style changes won't affect it.
Post by Urbatain
1) To prompt the player at the beggining of the game "do you wanna set
1 or set 2", for example. But it will need to create a main window to
print and input the response, then destroy the main window, switch the
styles and let inform to initialize the set of windows. Could it work?
Yes, that will work.
Post by Urbatain
2) Make an action for switching... destroy all windows, switch style
and recreate them... all this in game. Could it work?
That would also work. Closing and reopening the windows is how Adam does
the different colour schemes in Glulx Photopia, I think.

David
Cedric Knight
2004-05-25 22:50:03 UTC
Permalink
Post by David Kinder
Post by Urbatain
I wonder how to change the background color in the main window.
I tried to set it and clear the main window but doesn't work, but
Photopía 2.02 does it succesfull.
2) Make an action for switching... destroy all windows, switch style
and recreate them... all this in game. Could it work?
That would also work. Closing and reopening the windows is how Adam
does the different colour schemes in Glulx Photopia, I think.
It's also exactly how the SetColour(foreground, background [, selector])
function does it in Library 6/11. This is described on pp. 11-12 of the
release notes for Inform 6.3.

There are two minor advantages to using SetColour() - (a) the same code
should also work on the Z-machine; (b) the screen state is restored
after a RESTORE or UNDO. The disadvantage is that it is limited to the
standard two-window layout, but you can always Replace the routine with
a modified version and still have advantage (b).

HTH

CK

Andrew Plotkin
2004-05-25 18:17:34 UTC
Permalink
Post by Urbatain
Hi: (sorry my bad english and such... I'm spanish)
I wonder how to change the background color in the main window.
I tried to set it and clear the main window but doesn't work, but
Photop?a 2.02 does it succesfull.
Any help?
And... A more deep question. I'm trying to define two diferent sets of
styles in the same glulx game, but is evident that I cannot make it
between running the game because Gull says clearly that Glk put the
colors when intializing the windows, so if I define a new set of
styles by a prompt command, it won't work. I was thinking of possible
2) Make an action for switching... destroy all windows, switch style
and recreate them... all this in game. Could it work?
That will work fine.

--Z

"And Aholibamah bare Jeush, and Jaalam, and Korah: these were the borogoves..."
*
* Make your vote count. Get your vote counted.
Loading...