Overlay.pic

From AGI Wiki
Revision as of 20:02, 14 April 2019 by Andrew Korson (talk | contribs) (Created page with "The '''overlay.pic''' command draws a picture in memory without first clearing the existing picture. == Syntax == overlay.pic(var vPI...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

The overlay.pic command draws a picture in memory without first clearing the existing picture.

Syntax

overlay.pic(var vPICNUM);

Remarks

overlay.pic is similar to draw.pic, except the visual and priority screens are not cleared. This means that picture vPICNUM is overlayed and drawn on top of the existing picture.

Note that because fill commands in the picture resources only work on white portions of the screen, fills on the overlayed picture may not work if they overlap an area already set to a non-white color.

The show.pic command must still be used to display the drawn image on the screen once the picture has been overlayed.

AGI adds a script entry to the script stack each time an overlay.pic command is executed.

Possible Errors

Attempting to overlay a picture that has not been loaded will raise trappable error #18.

Example

Code:

<syntaxhighlight lang="agi"> load.pic(v0); [ load and draw the current room's picture: draw.pic(v0); discard.pic(v0); [ then overlay another picture on it v50 = 99; load.pic(v50); overlay.pic(v50); [ adds picture 99 discard.pic(v50); ... show.pic(); </syntaxhighlight>

Technical Information

Required Interpreter Version: Available in all AGI versions.
Byte-Code Value: 28 (0x1C hex)

See Also

Picture Commands
Working with Pictures