Cabal Common Library Doc Overlay
Overview
This is the main class for the overlay helpers with its members and part of the Cabal_Common_Library.
It handles 19 slots for inflight overlays (10x characters, 9x notifications) and uses shaders to place them on screen and works in a similiar way to the overlays in Vector (this OXP will be changed to use this mechanism).
The underlaying shader uses shaderInt1
and shaderInt2
for moving the overlay, shaderFloat1
for brightness, shaderFloat2
for highlighting (see ovSpeak()), shaderVector1
for positioning (x/y) and size (z) and shaderVector2
for coloring (only if cclov_color is used for character overlays).
As all overlays are done as screen aligned quads their appearance is based on the used screen resolution.
Methods
ovAdd()
worldScripts.Cabal_Common_Overlay.ovAdd( obj, off ) |
Adds overlay to one of the available slots. Added overlays will stay inflight until the calling script explicitely removes them, the VisualEffect becomes invalid or the autoremove option is used. All overlays will be removed when the player docks or leaves the system, but are respawned (offscreen) when the player launches or enters a new system. The script does not store anything to the savedgame though, so scripts are responsible to add them if necessary.
If used when docked the overlay will be stored and spawned offscreen when the player launches.
Parameters:
- obj
- Object. Properties see below.
- off
- Boolean. If true overlay is added, but offscreen.
Returns:
- result
- Visual Effect (or when docked true) or false.
Properties:
- cclov_id
- String. Unique Identifier. Required.
- cclov_type
- Number. 0=Notification, 1=Character. Required.
- cclov_blend
- Number. Duration for effect in seconds. Set to -1 for permanent.
- cclov_autoremove
- Boolean. Removes effect after cclov_blend seconds.
- cclov_fx
- String. VisualEffect to be used instead.
- cclov_png
- String/Texture. Must be specified if cclov_fx is not used.
- cclov_color
- Array. RGB values in range 0...3 for character overlays.
ovSpeak()
worldScripts.Cabal_Common_Overlay.ovSpeak( who, cclov_blend, message, whom, autoremove ) |
Lights up the overlay.
Parameters:
- who
- String. Identifier (see ovAdd() - cclov_id).
- cclov_blend
- Number. Duration for effect in seconds.
- message
- String.
- whom
- Entity.
- autoremove
- Boolean. Removes effect after cclov_blend seconds.
Returns:
- result
- Boolean. True on success. Otherwise false.
ovRemove()
worldScripts.Cabal_Common_Overlay.ovRemove( who ) |
Remove specified overlay.
Parameters:
- who
- String. Identifier (see ovAdd() - cclov_id).
Returns:
- result
- Boolean. True on success. Otherwise false.