Skip to content

Instantly share code, notes, and snippets.

@CrackerHax
Last active September 14, 2019 11:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CrackerHax/18855905c998a2f0dca3 to your computer and use it in GitHub Desktop.
Save CrackerHax/18855905c998a2f0dca3 to your computer and use it in GitHub Desktop.
Forced Overlay Test Script for highfidelity.io
(function()
{
// define colors
var black = { red: 0, green:0, blue:0};
var white = { red: 255, green:255, blue:255};
var window = [];
function newWindow(posx,posy)
{
var elements = [];
var element = Overlays.addOverlay("text", {
bounds: { x: posx, y: posy, width: 300, height: 120},
backgroundColor: white,
color: white,
backgroundAlpha: .1,
text: "\n This is a test panel",
alpha: 1
});
window.push(element);
}
function cleanup() {
closeWindow(window);
}
function closeWindow(window)
{
for(var i = 0; i < window.length; i++)
Overlays.deleteOverlay(window[i]);
}
Script.scriptEnding.connect(cleanup);
Window.domainChanged.connect(function()
{
Script.stop();
});
newWindow(300, 100);
})
@CrackerHax
Copy link
Author

Attached to a zone entity. When reloaded, will not delete the old overlay entities as it is supposed to.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment