Hi guys and gals,
I'm having a relatively simple problem. What I want is, when the cursor passes over the main character, he becomes partially transparent and it's possible to click objects and hotspots behind him.
I'm using the Tween module.
Code: AGS
The functions mentioned just simply tween the main character (hugo)'s transparency.
Code: AGS
The issue I'm having is that Character.GetAtScreenXY relies on the character having the clickable property enabled, which needs to be disabled when the mouse is hovering over him so that the player can click behind him.
If anybody has a solution or any ideas as to how I can achieve this, your help would me most appreciated.
I'm having a relatively simple problem. What I want is, when the cursor passes over the main character, he becomes partially transparent and it's possible to click objects and hotspots behind him.
I'm using the Tween module.
bool hugoFaded = false;
function repeatedly_execute()
{
if (IsGamePaused() == 1) return; //anything above is always done, below is what doesnt get done when paused
if (Character.GetAtScreenXY(mouse.x, mouse.y) == null && cHugo.ActiveInventory == null && hugoFaded){ //if mouse is not over hugo and hugo is faded out
fadeHugoIn(); //run fade hugo in
hugoFaded = false;
}
if(Character.GetAtScreenXY(mouse.x, mouse.y) == cHugo && cHugo.ActiveInventory == null&& !hugoFaded) { //if mouse is over hugo and hugo isnt faded
fadeHugoOut();
hugoFaded = true;
}
The functions mentioned just simply tween the main character (hugo)'s transparency.
function fadeHugoIn (){
cHugo.StopAllTweens();
cHugo.TweenTransparency(0.3, 0, eEaseOutTween, eNoBlockTween);
}
function fadeHugoOut(){
cHugo.StopAllTweens();
cHugo.TweenTransparency(0.3, 50, eEaseInTween, eNoBlockTween);
}
The issue I'm having is that Character.GetAtScreenXY relies on the character having the clickable property enabled, which needs to be disabled when the mouse is hovering over him so that the player can click behind him.
If anybody has a solution or any ideas as to how I can achieve this, your help would me most appreciated.