Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
screen_states [19-07-2017 10:06]
185.48.102.186
screen_states [19-07-2017 10:09]
185.48.102.186 [Screens]
Line 7: Line 7:
 ==== Screens==== ==== Screens====
 Screens are the different UI states when you browse something like menu/pause and highscores etc. In the //​MainUIScene//​ you can find a parent object //​MainUI/​MainUI//​ where all screens are located, basically when you want a different UI state or overlay on the same scene you create a new screen here. Each screen has a //​PT_Screen//​ script attached to it and has a variable //Depth// for layering purposes. You are free to activate/​deactivate and change screens. Easiest way to explain simply is by an example. Screens are the different UI states when you browse something like menu/pause and highscores etc. In the //​MainUIScene//​ you can find a parent object //​MainUI/​MainUI//​ where all screens are located, basically when you want a different UI state or overlay on the same scene you create a new screen here. Each screen has a //​PT_Screen//​ script attached to it and has a variable //Depth// for layering purposes. You are free to activate/​deactivate and change screens. Easiest way to explain simply is by an example.
 +
 Main menu cosists of a lot of states (Background/​Header/​Main/​Options/​Highscores/​Callibration and a few confirm screens) all of those you can see in this parent object, and they are activated with buttons and screen states. ​ Main menu cosists of a lot of states (Background/​Header/​Main/​Options/​Highscores/​Callibration and a few confirm screens) all of those you can see in this parent object, and they are activated with buttons and screen states. ​
  
-=== How the Interaction work===+==== How the Interaction work====
 We are going to show you this on the same Main Menu example. Main menu has 5 buttons where each leads to something. We are going to show you this on the same Main Menu example. Main menu has 5 buttons where each leads to something.
-//Play// button has a script //​PT_Screen_Bt_State//​ where the wanted screen state is dragged (in our case //​State_Game//​) and by click event the //​ButtonInteract//​ function in the script is activated and the state is opened. ​+ 
 +Play button has a script //​PT_Screen_Bt_State//​ where the wanted screen state is dragged (in our case //​State_Game//​) and by click event the //​ButtonInteract//​ function in the script is activated and the state is opened. ​ 
 Tutorial button is the same as play, but has a different screen state (//​State_Tutorial//​). Tutorial button is the same as play, but has a different screen state (//​State_Tutorial//​).
 +
 Options and Highscores buttons on the other hand have a script //​PT_Screen_Bt_GoTo//​ and will send you to another screen which is dragged and dropped from other screen object (ex. button Options has a screen //​Screen_Options//​ in the target screen gotten from //​MainUI/​MainUI/​Screen_Options//​). Button Quit has the same functionality and sends you to quit confirm screen. ​ Options and Highscores buttons on the other hand have a script //​PT_Screen_Bt_GoTo//​ and will send you to another screen which is dragged and dropped from other screen object (ex. button Options has a screen //​Screen_Options//​ in the target screen gotten from //​MainUI/​MainUI/​Screen_Options//​). Button Quit has the same functionality and sends you to quit confirm screen. ​
 +
 One more thing to note, //​PT_Screen_Bt_Back//​ is a script which returns you to your previous screen and is placed on all back buttons in the screens. One more thing to note, //​PT_Screen_Bt_Back//​ is a script which returns you to your previous screen and is placed on all back buttons in the screens.