This is the script (see below)that I have for a poster(object)in a room,
I want an image to pop up as I click on the poster,
how do I set it to show up and be able to click away from it once finished looking at it.
function POSTER_Interact()
{
aPaper.Play();
}
Thanks! :=
This is not what i'm looking for ;ShowPlayerCharacter - if checked, the player character will not be visible in this room, and the Walk mode will be disabled. Useful for close-up displays of control panels and so forth.
That would be a new room.
Best way is to make a GUI with the picture of the poster and turn it visible/invisible.
Thanks,I tried this,
{gGui1.Visible = true;}
How do I make it disappear
The image is there, and I adjusted where it shows up,
Just need to know, how to make it vanish, sorry i'm quite new to this program,
Thank for the help,I appreciate it!
gGui1.Visible = false;
You put the above code inside either a button, or on_click for the GUI, depending if you want it to be closed by clicking a specific place (button) or just anyclick on the GUI/picture will close it.
If you want to make the GUI disappear if the player clicks outside of the picture you could check if the player presses a mouse button inside the room's repeatedly execute function:
if (gGui1.Visible && mouse.IsButtonDown(eMouseLeft)) gGui1.Visible = false;
Quote from: Matti on Thu 11/02/2021 17:17:43
If you want to make the GUI disappear if the player clicks outside of the picture you could check if the player presses a mouse button inside the room's repeatedly execute function:
if (gGui1.Visible && mouse.IsButtonDown(eMouseLeft)) gGui1.Visible = false;
trying,thx
Roomscript on the Object,
function POSTER_AnyClick()
{
aPAPER.Play();
{
mouse.IsButtonDown(eMouseLeft);
gGui1.Visible = true;
}
}
with THIS on Globalscript:
function gGui1_OnClick(GUI *theGui, MouseButton button)
{
if (gGui1.Visible && (button == eMouseLeft || button == eMouseRight)) {
gGui1.Visible = false;
return;
}
}
And set them to Visible:False on Gui properties
I did it this way, but mabye I overcomplicated it?
What happens now is when I press my Object, the Gui(the image) pops up, and when the Gui(image) is clicked on it dissapears! Perfect..
Thanks for some help in the start
Is it possible to, have picture be displayed for like 1 second after it pops up,automatically closing?
Yeah, you would just set a timer to start when you click on it, and then in repeatedly execute you would check to see if the timer has expired and then set gGUI1.Visible to false.
Quote from: newwaveburritos on Thu 11/02/2021 19:53:21
Yeah, you would just set a timer to start when you click on it, and then in repeatedly execute you would check to see if the timer has expired and then set gGUI1.Visible to false.
Will look into it, thx