con las teclas Shift + Alt presionadas y seleccionas la posici贸n en
el anchor, creo que ya podrias ahorrarte el paso de poner 0 en la sposicioens X y Y, porque de una vez lo ubica.
Introducci贸n y configuraci贸n inicial
Bienvenida al curso
Cargando el proyecto
El sistema de UI de Unity
El sistema de UI de Unity
El componente Canvas
El Rect Transform
Componente de imagen
M谩scaras y efectos
C贸mo crear texto en Unity
Creando botones en nuestra interfaz
Otros elementos de UI
Auto layout
Scroll views
Canvas groups
Haciendo interfaces para el juego
Revisi贸n de las interfaces del juego
Importando nuestros assets
Diagramaci贸n de la pantalla del t铆tulo
Animando el fondo con shader graph
Agregando l贸gica a la pantalla de t铆tulo
Diagramaci贸n de la pantalla de selecci贸n de nivel
Implementaci贸n pantalla de selecci贸n de nivel
Ajustando el sistema de interfaz
Mejora de la interfaz del juego
Implementando la interfaz del juego
Diagramando la pantalla de pausa
Implementando la pantalla de pausa
Mejorando la pantalla de Game Over
Diagramaci贸n de la pantalla de configuraci贸n
Implementaci贸n de la pantalla de configuraci贸n
Muestra final y conclusiones
You don't have access to this class
Keep learning! Join and start boosting your career
The RectTransform is a fundamental component in Unity for creating user interfaces (UI). All objects within a canvas use this component for positioning, instead of the traditional Transform used in three-dimensional spaces. This component allows you to control the position on the X, Y and Z axes, as well as the width and height of the object in question. However, these properties depend on the alignment of the anchors configured on the object.
Anchor Presets are tools that define the position and size of an object in relation to a canvas. They are the key to making UI design more flexible, offering two main options:
By default, elements are placed with a centered Anchor Preset, allowing the object to be positioned in the center of the canvas when it was positioned at 0,0.
The Pivot point controls where all transformations of a UI object, such as scaling and rotation, are performed from. By adjusting the Pivot point, you can change the behavior of the transformations:
Example of usefulness: Setting the Pivot for one of these on X and Y axes can facilitate the creation of life bars, allowing scaling to occur from left to right.
When working with UI design, the ability to adapt to different screens and resolutions is crucial. Using Stretch mode to set up a RectTransform offers great flexibility:
For example, by setting the margins to 100, we provide extra space between the object and the edge of the canvas.
Imagine that you need a bar at the top that extends from one side of the screen to the other:
This approach ensures that the bar stays at the top regardless of the resolution.
For UI elements in corners (e.g., top left, top right):
Skill in handling the RectTransform is acquired through constant practice and experimentation with the different Anchor Presets, Pivot points and RectTransform properties. By exploring the different functionalities, you will not only master interface design in Unity, but you will also be able to create adaptive structures that stand out on any platform. Keep exploring and learning to perfect your UI design skills in Unity!
Contributions 3
Questions 0
con las teclas Shift + Alt presionadas y seleccionas la posici贸n en
el anchor, creo que ya podrias ahorrarte el paso de poner 0 en la sposicioens X y Y, porque de una vez lo ubica.
Want to see more contributions, questions and answers from the community?