CreateGraphicOverlay (int x, int y, int slot, int transparent)Creates a screen overlay containing a copy of the image from SLOT in the Sprite Manager. The image is placed at (X,Y) on the screen (these are screen co-ordinates, not room co-ordinates). If TRANSPARENT is 1 then the overlay will be drawn in the same way as characters/objects, if it is 0 then the a black rectangle will be painted behind the sprite.
See the description of CreateTextOverlay for more on overlays.
Example:
CreateGraphicOverlay(100,100,300,1);will create an overlay of the image stored in sprite manager’s slot 300, at the coordinates 100,100.
See Also: CreateTextOverlay, RemoveOverlay
CreateTextOverlay (int x, int y, int width, int font, int color, string text)Creates a screen overlay containing the text you pass at the position specified. A screen overlay looks identical to the way speech text is displayed in conversations, except that with this command the text stays on the screen until either you remove it with RemoveOverlay, or the player goes to a different room, in which case it is automatically removed.
The X and Y parameters specify the upper-left corner of where the text will be written. WIDTH is the width, in pixels, of the text area. FONT is the font number from the editor to use (0 is the normal font, 1 is the speech font). COLOR is the text color - use one of the colours from 1 to 15. Finally, TEXT is obviously the text that gets displayed.
The function returns the Overlay ID, which you use later to reposition and remove the overlay.
NOTE: screen overlays, in the same way as objects, slow down the game while displayed.
NOTE: there is currently a maximum of 3 overlays displayed at any one time
Example:
CreateTextOverlay (50,80,120,2,15,"This is a text overlay");will display a 120 pixels text area with its upper left corner at coordinates 50,80 containing the string "This is a text overlay" using font number 1 and green color.
See Also: CreateGraphicOverlay, MoveOverlay, RemoveOverlay
MoveOverlay (int overlay_id, int x, int y)Repositions screen overlay OVERLAY_ID to have its upper-left corner at (X,Y). The move is instant (ie. it doesn't gradually glide over to the new position).
Example:
int over1; over1=CreateTextOverlay (50,80,120,2,15,"This is a text overlay"); Wait(200); MoveOverlay(over1,100,100);will create a text overlay , wait for 200 game cycles (about 5 seconds) and then move the overlay to coordinates 100,100.
See Also: CreateTextOverlay, RemoveOverlay
RemoveOverlay (int overlay_id)Removes the specified overlay from the screen. OVERLAY_ID is the value returned from the overlay creation functions like CreateTextOverlay.
Example:
int over1; over1=CreateTextOverlay (50,80,120,2,15,"This is a text overlay"); Wait(200); RemoveOverlay(over1);will create a text overlay , wait for 200 game cycles (about 5 seconds) and then remove the overlay from the screen.
See Also: CreateTextOverlay
SetTextOverlay (int overlay_id, int x, int y, int width, int font, int color, string text)Similar to CreateTextOverlay, except that this function replaces an existing overlay with the new text. This has two advantages over simply using RemoveOverlay followed by CreateTextOverlay to change the text - it is one function call, and it allows you to keep the same overlay ID number.
Example:
int over1; over1 = CreateTextOverlay (50,80,120,2,15,"This is a text overlay"); Wait(200); SetTextOverlay (over1, 50,80,120,2,15,"This is another text overlay");will create a text overlay , wait for 200 game cycles (about 5 seconds) and then replace the overlay with another one.
See Also: CreateTextOverlay, RemoveOverlay