2016-02-08 23:45:57 +01:00
|
|
|
.. _doc_splash_screen:
|
2016-02-08 22:07:55 +01:00
|
|
|
|
2016-02-07 22:54:52 +01:00
|
|
|
Splash screen
|
2016-02-06 01:54:33 +01:00
|
|
|
=============
|
|
|
|
|
|
|
|
Tutorial
|
|
|
|
--------
|
|
|
|
|
|
|
|
This will be a simple tutorial to cement the basic idea of how the GUI
|
2016-02-29 05:26:11 +01:00
|
|
|
subsystem works. The goal will be to create a really simple, static
|
2016-02-06 01:54:33 +01:00
|
|
|
splash screen.
|
|
|
|
|
2016-03-06 17:42:31 +01:00
|
|
|
Following is a file with the assets that will be used. These can be added directly to your project folder—no need to import them:
|
|
|
|
|
2016-02-10 23:22:56 +01:00
|
|
|
:download:`robisplash_assets.zip </files/robisplash_assets.zip>`.
|
2016-02-06 01:54:33 +01:00
|
|
|
|
2016-02-19 22:00:07 +01:00
|
|
|
Setting up
|
2016-02-06 01:54:33 +01:00
|
|
|
----------
|
|
|
|
|
2016-03-17 21:12:24 +01:00
|
|
|
Set the display resolution to 800x450 in Project Settings, and set up a new scene like this:
|
2016-02-06 01:54:33 +01:00
|
|
|
|
|
|
|
.. image:: /img/robisplashscene.png
|
|
|
|
|
|
|
|
.. image:: /img/robisplashpreview.png
|
|
|
|
|
2016-02-19 22:00:07 +01:00
|
|
|
The nodes 'background" and "logo" are of :ref:`TextureFrame <class_TextureFrame>`
|
2016-02-06 01:54:33 +01:00
|
|
|
type. These have a special property for setting the texture to be
|
|
|
|
displayed, just load the corresponding file.
|
|
|
|
|
|
|
|
.. image:: /img/texframe.png
|
|
|
|
|
2016-02-19 22:00:07 +01:00
|
|
|
The node "start" is a :ref:`TextureButton <class_TextureButton>`,
|
2016-02-06 01:54:33 +01:00
|
|
|
it takes several images for different states, but only the normal and
|
|
|
|
pressed will be supplied in this example:
|
|
|
|
|
|
|
|
.. image:: /img/texbutton.png
|
|
|
|
|
2016-02-19 22:00:07 +01:00
|
|
|
Finally, the node "copyright" is a :ref:`Label <class_Label>`.
|
|
|
|
Labels can be set a custom font by editing the following property:
|
2016-02-06 01:54:33 +01:00
|
|
|
|
|
|
|
.. image:: /img/label.png
|
|
|
|
|
2016-02-08 23:45:57 +01:00
|
|
|
As a side note, the font was imported from a TTF, see :ref:`doc_importing_fonts`.
|