BSA228 Week six - Unity Menu

UI> canvas >
Camera change from skybox to solid color

Change the font in Unity

Search for the font you would like to use and copy it into the Asset folder and create a fonts folder in there. Then paste the previously selected font into the folder. 


To enter the font I click and drag the font into the place for the font in the Inspector.










The result is this.












Button
create a button for the menu over Create > UI > Button. In the Inspector you can change the attributes of it. 

Change the button sprite from a Photoshop file. You put your file into the image folder. In Unity, we cut the sprite into the different buttons and apply it. For the cutting, we use the Sprite Editor.

After we applied it we can select the different buttons separately. I changed my button into this. You change it over the Inspector at SourceImage.


Now the colors aren't applied anymore because of its transparency. I can change the shape of the button so it changes when I'm hovering over it or click it. We change the Transition to Sprite Swap. And then put the different types of buttons in the Highlighted Sprite and Pressed Sprite.



Connecting the Level through button script and button click

We write a script where we access the new Scene. We put the script to the MainMenu object and enter in the public value the LevelOne. 


















Before it will work we need to put our scenes into the build. Just drag and drop and drag the scenes into it. Now we can open the LevelOne by clicking on the Start-Button.

Kommentare