The script is attached to the background Entity
The background is initially a blank square, and upon the the start of the room it successfully changes to "1.Sprite" since Panel.Intro is 1.
Panel 1:
Panel 2:
A button is pressed to change Panel.Intro from 1 to 2, the debug shows that Panel.Intro does indeed change.
But still as shown in the gif, it doesn't switch panels.
Just in case, the code for the button which changes the Panel.Intro variable:
global Panel;
on "LeftClick"
{
Panel.Intro = Panel.Intro + 1;
global Cutscene;
Game.UnloadObject(Cutscene);
}
And entirety of code I posted before:
#include "scripts\base.inc"
/////Cutscenes/////////////////
global Panel;
global Cutscene;
var background = Scene.GetNode("background");
var animation = background.GetSpriteObject();
if(Panel.Intro==1)
{
background.SetSprite("interface\Cutscenes\Scenes\1.sprite");
}
if(Panel.Intro==2)
{
background.SetSprite("interface\Cutscenes\Scenes\2.sprite");
}
if(Panel.Intro==3)
{
background.SetSprite("interface\Cutscenes\Scenes\3.sprite");
}
if(Panel.Static==true)
{
animation.Pause();
}
if(Panel.Static==false)
{
animation.Play();
}
Cutscene.Center();