Posted: Wed Jan 20, 2010 9:30 pm
As for changing the whole screen color without clearing what's already there, I'm pretty sure you can't. If I recall, I spent hours trying to figure that out for The Traveling Swordsman, and ended up having no choice but to clear the screen in order to change the background color (and the foreground color of any already-printed text). Load the game and type >STYLE DEFAULT and >STYLE CUSTOM to see what I mean.
As for changing the color for a block of text without the screen's background being to the right of lines that wrap before the screen's rightmost edge, you *might* be able to do that by setting a window. I haven't tried it, but I think you'd be able to get the current line, start a text window with the colors you want, then end then window when you're done. Check pages 147 and 148 in The Hugo Book. Might be a dead-end, but it's about the only way I know of to do what you want.
Well, there is probably one other way, but it'd be a pain. If you set the font to fixed-width and write a routine that pads you each line out to the display width, it might work. Basically you'd have to print the line then use the "print to" command specifying the column width of the display to fill in the empty space. But I'm not sure how you'd dynamically break the lines apart offhand. I could probably figure it out given a few hours. Ha ha.
As for changing the color for a block of text without the screen's background being to the right of lines that wrap before the screen's rightmost edge, you *might* be able to do that by setting a window. I haven't tried it, but I think you'd be able to get the current line, start a text window with the colors you want, then end then window when you're done. Check pages 147 and 148 in The Hugo Book. Might be a dead-end, but it's about the only way I know of to do what you want.
Well, there is probably one other way, but it'd be a pain. If you set the font to fixed-width and write a routine that pads you each line out to the display width, it might work. Basically you'd have to print the line then use the "print to" command specifying the column width of the display to fill in the empty space. But I'm not sure how you'd dynamically break the lines apart offhand. I could probably figure it out given a few hours. Ha ha.