Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: krane on February 05, 2017, 09:31:59 AM

Title: How to make popup window? [SOLVED]
Post by: krane on February 05, 2017, 09:31:59 AM
Hi
How would I make a popup window (for instance, with dialogue) that the user can then close?
thanks
Title: Re: How to make popup window?
Post by: elusiven on February 05, 2017, 10:03:10 AM
Create a canvas or attach a panel to existing canvas. On that panel design your pop up window add text, buttons etc.

Now create a new FSM template and create 3 new string variables for the main text and two for button texts. make all of them public ,, tick inspector on all variables ,,

On the first state get the go of that canvas or panel of the popup. And on second state do a bool test action with that switch off variable. If the bool is true then do a state where you turn off that popup ,,deactivate game object ,,  if bool is false then we turn on the popup and we set all text for it and we listen for button clicks. Then depending on which button is pressed we send an event to the host fsm and we switch of the popup.

You can run this now using "run fsm " action and you can pass in any text for your popup

This is more or less my way. This is a universal popup that you can use in whole game for just about anything.

If you don't want your own popups you can also use the native ones to the os.
Title: Re: How to make popup window?
Post by: krane on February 05, 2017, 11:30:15 AM
Thank you! I'm having difficulty with Unity generally and the differences between panels, canvases and windows ... ergh.

Title: Re: How to make popup window?
Post by: elusiven on February 05, 2017, 02:26:38 PM
No problem, I suppose I could make a couple of youtube videos if that would help.
Title: Re: How to make popup window?
Post by: marv on February 06, 2017, 06:58:24 AM
There are a bunch of very good and in-depth tutorial series on youtube that helped me a lot when I first started out. They are not playmaker specific but they do a great job explaining the basic unity UI elements and how they are used. I found it pretty easy and intuitive to then "translate" the few things that were done via scripting to playmaker actions.

I can only recommend getting the hang of how to work with the UI elements first, it makes things easier in the long run.

cheers

edit: I believe this was one of them: https://www.youtube.com/playlist?list=PLt_Y3Hw1v3QTEbh8fQV1DUOUIh9nF0k6c