Screens

The Screens System is an interface solution. It is mainly used to create the intro/ splash screens, the language selection screen and loading screens but can also be used to create screens like the main menu and in-game HUD and panels.

Screens are based on the Unity OnGUI() solution. You might want to create your game menu(s) and in-game HUD and panels with a solution like the new Unity GUI, NGUI, Daikon Forge, etc. as they are more robust. Only the Splash Screens and Language Selection screens should always be created with the Screens editor. Loading screens are normally very simple and might also be worth doing in the Screens editor rather than another solution.

The screens editor can be opened from the Toolbar or menu: Tools > PLYoung > plyGame > Screens Editor and is divided into several tabs, used to edit various types of screens.

Splash Screens

These are what you will see once the game has started. They normally show company logos or short videos. Each splash screen you define will follow on the one before it until no screen is left to be shown, after which time the language screen will be shown, if any was created.

For each of the screens you define you will be able to set the following:

Language Screen

The Language Screen follows on the Splash Screens and is used by the player to select the language to play in, if any is defined. To skip this screen you simply don’t add any elements to it.

Important You need to set either the Screens or Scene option in this screen’s settings, else plyGame will not know how to move on from this screen.

The following options are specific to this screen, under its settings:

Loading Screens

plyGame has a default loading screen that simply shows “Now Loading …” when you do not define any screens here. There are only two cases in which plyGame will automatically show a loading screen and it will only be this default screen. They are when the game starts for the first time and then again after the language screen is closed. In both cases loading might be so fast that you will never noticed the loading message.

For any other time you want a Loading screen visible you will make use of Blocks to show or hide the screen.

The Min Load Time option allows you to add an artificial delay before the screen will be hidden. This will cause the screen to be visible for a minimum amount of time even if you make a call (via Blocks) to hide the loading screen.

The Click to Continue option will cause the screen to stay visible and wait for the player to press a button before the loading screen will be hidden. The player will not be able to click until you made call to hide the screen. It would be good to add an element to the screen that tells the player that he needs to press a button to continue. This element could be hidden by default and then when you make the call to hide the load screen you can set this element to visible. The player will then see the notification and the screens system will be in a state where it is waiting for the button press before actually hiding the loading screen.

Text (by default “now loading …”) can be changed to what you want it to be. Tip: if you are using uGUI for all your interface work then you might want to simply set this to an empty value to prevent some cases where this text would be shown for a split seconds while your UI is already visible.

Tip If it seems the loading screen won’t go away then it is possibly because you forgot to make a call to do it. plyGame do not automatically hide the loading screen after a level/ scene has loaded as it can’t predict whether you might want to load additional scenes or not. You have to actually make a call for it to be hidden via a Block like GUI > Hide All Screens. A good place to put this Block is in the Common > On Start or Common > On State Enter Event of a Blox in the game scene. Normally you will have a GameObject in your game scenes for the sole purpose of handling misc things like this.

Custom Screens

Here you can define menus, panels, HUD, etc that is used in your game. Showing and hiding these screens are done by using Blocks (in plyBlox). There are no unique settings for these screens. Have a look at the next section to learn more about the settings that all screens have in common.


Settings or Properties

Just under the list of screens, to the left-hand side of the Screens editor is the properties of the Screen and/ or selected Element.

The Screen properties include:

Below the Screen properties will follow a list of all Elements placed on the screen or, if an Element is selected, the properties for that Element.

UI Element

With a screen element selected you will notice the first set of properties for that element under ‘UI Element’. These are settings/ properties common to all screen elements.


The Screen Elements

Along the top of the screen editor is a toolbar containing buttons to create the elements that can be placed on a screen.

Text

The Text element is used to, well, show some text on the screen.

Button

A Button is something a player can click on. It won’t do anything if you do not link an Event to it. To link an event you simply enter the name of a Common > Custom Event that should be called in the GUI plyBlox when the button is pressed. You can click on the ‘Edit’ button to open the Screens’ plyBlox prefab in the plyBlox Editor and add the event.

Text Field

The Text Field is used by the player to enter text or numbers which you can then later retrieve for whatever use.

Toggle

A Toggle has an On (True) or Off (False) state.

Image

The Image element is used to show an Image on the screen.

Box

The Box or Frame element is used to show a simple box shape on the screen.

Movie

The Movie element is used to show video stream on the screen and can also play an audio stream when the video is started.
Unity Pro: Video playback requires Unity Pro. Windows, OSX and Linux only.


plyBlox

The Screens System does not trigger any specific Events. The Screens system has its own Blox object where its elements can trigger Events on. The Button can for example trigger a Common > Custom Event. The Blox object is stored in a prefab called “ongui” in Assets/plyData/System/.

Blocks related to the Screens System is provided in the category: GUI > Screens (plyGame). They include Blocks that can show and hide screens. Since the Screens System is based on Unity’s OnGUI() you might also be interested in the OnGUI Event and the Blocks in GUI > OnGUI. These could be used to extend what is shown on a screen.

--eof--