Playmaker Forum
PlayMaker News => General Discussion => Topic started by: PolyMad on February 22, 2019, 01:01:24 PM
-
Is there a particular reason why there are no actions to treat the Unity GUI Panel elements?
-
Hi.
Not sure what you mean?
The ui panel contains a rect trasform and an image which both have actions.
Only the Canvas Renderer does not have an action for it.
If you need this i can make it for you.
-
I mean, I see many actions for the GUI, but none of those is about the GUI PANELS.
How do you manage the different GUI screens, like in example a screen for SETTINGS, another for choosing maps, etc., without using Panels?
-
Hi.
The Panels work kind of like an empty parent, except it has rect transform, a Ui image and a Canvas Renderer included.
So the Panel does not have its own class, that's why there are no actions for Panel :)
-
Sorry but I don't understand.
Aren't panels supposed to be something like different screens that you can turn on and off inside a Canvas?
I thought this was their task.
If this is not their task, what are they for?
And how do you deal with more screens? You make many Canvas???
-
Hi.
in the "Panel" you can group buttons etc for a "screen"
Then you can just disable/enable them like standard gameobjects,
animate/slide them off screen or Enable/Disable Raycast Target, which would block raycasting stuff behind the panel.
-
So Panels are not considered in Playmaker actions because they would block the raycasts?
I still can't understand how do you replace them, after you write that, like I supposed, they can be considered "screens"...
-
Hi.
No, There is no Class for a 'Panel' see this post on unity :
https://answers.unity.com/questions/800208/what-class-is-a-panel.html
as there is no class we can't really make actions for it :)
A panel is the same , as you would create an empty game object and add the 3 components i mentioned.
-
Duh!
What the hell? So why did they put that item in Unity GUI? I can't understand this! :o :o :o
Could you please tell me which is the right workflow to add "screens" to a canvas then? Thank you :)
-
Hi.
Well, a empty game object has a Transform component and in canvas you need to use a rect transform.
That's the main reason i guess.
To make a menu screen, you can use the panel as a parent and inside it place you buttons etc.
Then you can animate the panel to move in/out the screen, or enable disable the panel (or enable/disable the raycast target on the image from the panel)
Here is a tutorial which you could have a look at (its not playmaker, but i think most you can understand)
-
So, in other words, a panel is simply an object to which some classes are appended, right?
And from Playmaker I will animate the object itself (turn on/off) like any other.
-
Hi.
Yes.
you can use the rect transform for movement with rect actions or animation/animator.
you can enable/disable the raycast in the panel so that things behind can't be pressed/triggered.
rest is same as on other objects.
-
Thank you very much, Dino!