overlay (roll option): Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
(Fill out with an example and categories.)
No edit summary
Line 1: Line 1:
{{stub}}[[Category:Roll Option]][[Category:Display Roll Option]][[Category:Overlay Function]]
{{RollOption
|name=overlay
|version=1.7.0
|description=[[Image:overlay_example.png|thumb|right|Selected units have health bars rendered in the top left in an overlay.]] Places a transparent HTML5 overlay over the map view. Players can click through the overlay to affect the map as normal, but clickable effects on the overlay will work as intended. Using HTML5, CSS, and JavaScript, overlays enable graphical user interfaces akin to Diablo and WoW right in MapTool.


[[Image:overlay_example.png|thumb|right|Selected units have health bars rendered in the top left in an overlay.]]
Because overlays can't be closed like a frame or a dialog, users can instead toggle them on or off in the {{ui location|Window > Overlays}} menu.
Overlays are a MapTool 1.7+ feature which places a transparent HTML5 overlay over the map view. Players can click through the overlay to affect the map as normal, but clickable effects on the overlay will work as intended.
Using HTML5, CSS, and JavaScript, overlays enable graphical user interfaces akin to Diablo and WoW right in MapTool.


Overlays can be called much like [[frame5 (roll option)|frames]] and [[dialog5 (roll option)|dialogs]]:
|usage=
<pre>[overlay("MyOverlay"): { <h1 style='color:white;'>Hello, World!</h1> }]</pre>
<source lang="mtmacro" line>
[overlay(overlayName): { ... }]
</source>


Because overlays can't be closed like a frame or a dialog, users can instead toggle them off in the {{ui location|Window &gt; Overlays}} menu.
The title parameter '''overlayName''', should be a string that specifies the internal name of the overlay. It is also the name of the overlay as it will appear in {{ui location|Window &gt; Overlays}} menu.


|examples=
The following code simply prints 'Hello World' in large white letters at the top left of the map view:


== See Also ==
<source lang="mtmacro" line>
* [[frame5 (roll option)]]
[overlay("MyOverlay"): { <h1 style='color:white;'>Hello, World!</h1> }]
* [[dialog5 (roll option)]]
</source>
* [[onChangeSelection]] event
 
* [[Whitelisted Content Delivery Networks]]
|also=
{{roll|frame}} <br>
{{roll|frame5}} <br>
{{roll|dialog}} <br>
{{roll|dialog5}} <br>
[[Whitelisted CDNs]]
|changes=
{{change|1.7.0|Introduced.}}
 
}}
 
[[Category:Display Roll Option]]
[[Category:Overlay Function]]
[[Category:Roll Option]]

Revision as of 22:39, 12 May 2020

[overlay():] Roll Option

* Introduced in version 1.7.0
File:overlay example.png
Selected units have health bars rendered in the top left in an overlay.

Places a transparent HTML5 overlay over the map view. Players can click through the overlay to affect the map as normal, but clickable effects on the overlay will work as intended. Using HTML5, CSS, and JavaScript, overlays enable graphical user interfaces akin to Diablo and WoW right in MapTool.

Because overlays can't be closed like a frame or a dialog, users can instead toggle them on or off in the Window > Overlays menu.

Usage

[overlay(overlayName): { ... }]

The title parameter overlayName, should be a string that specifies the internal name of the overlay. It is also the name of the overlay as it will appear in Window > Overlays menu.

Examples

The following code simply prints 'Hello World' in large white letters at the top left of the map view:

[overlay("MyOverlay"): { <h1 style='color:white;'>Hello, World!</h1> }]

See Also

[frame():]
[frame5():]
[dialog():]
[dialog5():]
Whitelisted CDNs

Version Changes

  • 1.7.0 - Introduced.