Main Page
Character
Cursor
Dialogue
Display
File
Game
GUI
Inventory
Music,Sound,Flic
Palette
Object
Room
Screen
String
| |
CyclePalette (int start, int end)
This is used for special effects, like the flowing colours on the Space
Quest 4 title screen, and the Sierra logo of the later Sierra games.
The palette indexes from START to END are cycled around one slot. Using
this call in a repeatedly_execute function gives the effect of animation.
NOTE: This function does not work in hi-colour mode.
Example:
CyclePalette (100,150);
SetPalRGB (int slot, int red, int green, int blue)
Changes the RGB components of one of the palette slots. The palette is
initially set up in RoomEdit, but you can override it during the game using
this function for special effects. The RED, GREEN and BLUE parameters each
range from 0 to 63 (as used in the Palette Editor).
If SLOT is a background slot, then this function's effect will last until
the player changes screen, when the palette is changed to the new room's
palette. If SLOT is not a background slot, the effect of this function is
permanent.
Note: This function will allow you to change the colours which are "locked"
in the Room Editor. However, you should not normally do this as it can
cause strange colours in the game.
Example:
SetPalRGB (14,34,21,9);
UpdatePalette()
Commits the changes you made to the game palette.
The text script global variable palette[] stores the state of all the
colours of the palette. You can access the red, green and blue components
with .r, .g and .b. The values range from 0 to 63.
Example:
palette[16].r = 60;
UpdatePalette();
would make the black colour turn
bright red. When you actually change the variable, nothing happens. Call
this function to update the screen.
GLOBAL VARIABLES
palette[SLOT].r
The red component (0-63) of palette slot SLOT
Example:
palette[16].r = 60;
palette[SLOT].g
The green component (0-63) of palette slot SLOT
Example:
palette[16].g = 20;
palette[SLOT].b
The blue component (0-63) of palette slot SLOT
Example:
palette[16].b = 45;
|