Overlay Disappearing

Started by Pax Animo, Thu 08/09/2022 17:53:53

Previous topic - Next topic

Pax Animo

Heya,

I'm trying to create a simple overlay which stays on-screen until i decide not, I've read the Manuel and it's say to declare the Overlay* at the top of the script,

Code: ags
// room script file
 Overlay* myOverlay;

function room_Load()
{
  myOverlay.CreateGraphical(100, 100, 6);
}


The overlay appears for a few seconds and then disappears.
Misunderstood

Crimson Wizard

CreateOverlay is a static method (called from the type, rather than the particular object) that returns overlay object. You must save that object in a variable:

Code: ags

myOverlay = Overlay.CreateGraphical(100, 100, 6);

SMF spam blocked by CleanTalk