You don't have access to this class

Keep learning! Join and start boosting your career

Aprovecha el precio especial y haz tu profesión a prueba de IA

Antes: $249

Currency
$209
Suscríbete

Termina en:

0 Días
6 Hrs
29 Min
5 Seg

Diagramación de la pantalla de selección de nivel

19/29
Resources

How to layout a level selection screen in Unity?

Creating an effective level selection screen is fundamental to provide a smooth and clear user experience in any game. This process may seem complicated at first, but with the right techniques and tools, such as those offered by Unity, it is possible to achieve it efficiently. Let's take a look at the steps necessary to diagram a level selection screen.

How to create the basic structure?

To begin with, it is crucial to see a representation of the screen you want to create. In this case, we use a list with a Scroll View to display the levels, along with a "Back" button to return to the main screen.

  1. Disable unnecessary elements: Disables the current screen and its UI elements that will not be used.
  2. Add main image: In the main UI element, add a new image for level selection. Name this component as UI Level Selection.
  3. Configure Main Image: Adjust its settings to have a Stretch in all directions with a background color of your choice, in this case, a blue.

How to split the screen?

Dividing the level selection screen into panels helps to better organize the elements.

  1. Add new UI element: Add a new UI element, starting with an image to get the Rect Transform. Remove the image component later if only the Rect Transform is needed.
  2. Set pivots and Stretch: Set the pivots in Stretch and adjust the position and size of the elements to create a space where the "Back" button will go.
  3. Set Level Bin: Name this element as LevelList. All levels will be placed here.

How to organize the list of levels?

  1. Create Level Container: Inside LevelList, create a new element called container with a Vertical Layout Group.
  2. Set Auto Size: Set the Content Size Filter to Horizontal Fit without restrictions and Vertical Fit to Preferred Size.
  3. Add elements to the container: Copy an existing button, such as the options button, and adjust it to use it as a level template. Align the text inside the button with Stretch and set the padding.

How to add Scroll View?

  1. Add Image and Mask component: Add an image to the LevelList with zero opacity and a Mask component to prevent levels from being visible outside their list.
  2. Configure Scroll View: Add Scroll Rect component to define the content of the Scroll and the Viewport. Activate vertical scrolling only.

How to integrate the "Back" button?

  1. Copy and adjust button: Copy the home button, adjust it and put it in the lower left position of the screen.
  2. Modify button properties: Change the name to btnBack and adjust its orientation and size to align the icon where you want.

With these steps, you have a well laid out and visually coherent level selection screen. Don't forget that these elements can be further adjusted and customized according to the needs of your project. Keep experimenting and learning to take your game to the next level - keep going, practice makes perfect!

Contributions 2

Questions 0

Sort by:

Want to see more contributions, questions and answers from the community?

Para la máscara, también se puede dejar la opacidad en 1, así no se ve la imagen y se ve todo el contenido.
Esto nos ayuda para cuando el fondo es mas complejo que un color sólido.