Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Pax Animo on Thu 08/09/2022 17:53:53

Title: Overlay Disappearing
Post by: Pax Animo on Thu 08/09/2022 17:53:53
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) Select
// room script file
Overlay* myOverlay;

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


The overlay appears for a few seconds and then disappears.
Title: Re: Overlay Disappearing
Post by: Crimson Wizard on Thu 08/09/2022 18:25:38
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) Select

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