unity make a menu, the basics
-
dev log, NZK's GNZ day 1
- make a game scene and a menu scene
- IDK how to make an empty one
- so I copied and pasted the default one in the assets folder and renamed it
- then I dragged into the hierarchy area
- I renamed them then reloaded/refreshed em when it asked me to
- how do I move in the scene
- click the hand tool, then right-click it and WASD and scroll wheel to move faster like Minecraft spectator mode + playing Roblox for moving the camera side to side up and down
- when I create a panel in the wrong scene it won't let me change to the scene I want
ask Kunal
- IDK how to make an empty one
- create a panel,
- right click in the correct scene, UI>panel
- this will create a canvas with a panel
- how to change bg img
- import img
- click on file
- change the texture type to 2d and UI if it asks you to refresh do it
- click on panel
- drag the img onto the panels img source img area, it should give a + symbol on your mouse
- click on panel
- change the texture type to 2d and UI if it asks you to refresh do it
- click on file
- then rename your panel to "background" so you remember that its a background img/panel
- import img
- create text!
- open asset store for custom fonts on older versions,
-
-
Click on the "Window" menu at the top of the screen.
-
From the dropdown menu, select "Asset Store."
- if on a newer version open the package manager instead of the asset store
-
If this is the first time you are opening the Asset Store, Unity will prompt you to log in using your Unity account credentials. If you don't have a Unity account, you will need to create one.
-
Once you are logged in, the Asset Store window will open, showing various assets, packages, and resources available for download and use in your Unity project.
-
- then install or make sure text mesh pro is installed
-
- right click on the menu scene
- hover over ui
- click text mesh pro
- it may ask you to import stuff, do it
- on the inspector menu for the text, u can scroll down to underlay, use this to create a fake shadow if you want
- make sure you're text is in front of the img, it needs to be under the background in the hierarchy
- create a color gradient
- go to the text mesh pro folder
- mouse menu creates text mesh pro color gradient
- right click to open the mouse menu
- text mesh pro
- click color gradient
- name it
- click on the file you just created
- click color mode and do 4 corners gradient
- each rectangle corresponds to the 4 corners of the text and it will make a gradient from each corner to the others based on relative space
- create a color gradient
- create a button
- in canvas under your text, make a button,
- use mouse menu
- go to UI
- then button, probably text mesh pro
- use mouse menu
- scale the button to be similar in size to your text object or the relative size to your text
- this button usually comes with a text object, you can replace that one with the one you just made
- if you do this
- rename button to "PlayButton"
- rename the text you created and moved into the button object to Text
- make text center to button
- click on Text, the object
- In the inspector, in the rect transform area,
- click the stretch, align/ arrows in a box
- then hold alt then click the bottom right option for stretching in all axis
- if you do this
- make the button state, and show visual feedback to the user when hovering. highlight lowlight, when selected or not
- go to button
- right click the button and look in the inspector
- set normal color alpha to 0
- change the highlighted color to not 0 but not max
- set pressed color to a darker color
- set the disabled color to whatever you want, usually grayed out
- go to button
- duplicate button for other settings
- right click on the desired button
- ctrl+c
- ctrl+v
- click the new button and hold shift to drag only on one axis
- repeat till you are satisfied with the number of buttons
- drag with the right mouse button
- resize your buttons to only fit the text, or fit your needs
- hold alt to mirror the padding changes on both sides of the button
- just try this it doesn't make sense when reading
- hold alt to mirror the padding changes on both sides of the button
- rename your buttons
- edit the text
- create the MainMenu canvas
-
- click canvas
- create blank
- rename to MainMenu
- resize it to fit all the elements
-
- drag all of your buttons onto the MainMenu object
- ctrl+click and specifically target the buttons
- or highlight a list of objects all at once
- click the first item on the list
- shift click the last item on the list
- duplicate the main menu object and rename
- right-click the main menu object to bring up the mouse menu
- click duplicate
- rename to "OptionsMenu"
- or whatever new menu you want to link to a button
- temporarily disable the MainMenu
- right click MainMenu
- in the inspector window uncheck the check box on the top left
- we do this so we don't mess up the MainMenu when editing things
- time to make a volume slider
-
- click options menu
- open mouse menu
- hover over UI
- Select Slider
- resize it to your liking
- color it to your liking
- hide the handle
- slider>handle slide area>handle
- disable the img compontent
- select the background
- color the sliders bg to your liking & decrease the alpha
- slider>fill area>fill
- change the color, this will be the indicator of how loud you want things to be
- link to tutorial to make the slider do things
-
- in canvas under your text, make a button,
- don't edit play mode without saving plz
- Titlebar>file>buildsettings
- go to assets in project area
- drag the scenes of your game into the scenes in build area in the builds settings window
- the number to the right is called the build index
- open asset store for custom fonts on older versions,
- right click in the correct scene, UI>panel