How to add a sprite image to UI button and scale it properly | Unity quick tip

preview_player
Показать описание
#UnityTutorial #SimpleUnityGame #unityscaleui
In this short tutorial video I will show you how to add a 2D sprite image to UI button in Unity game and make this button be scaled properly so the corners of this button stay rounded if button is scaled. We set a borders to this image with Unity sprite editor feature so rounded corners of the image will not be scaled and maintain their shape.

TO BLAST! - My New Fun Relaxing Puzzle Game Available On Google Play Store

Consider purchasing my ULTIMATE UDEMY COURSE with great discount

What this video is about and what it can be used for also: unity 2d tutorial,
unity tutorial, scale UI button properly, How to add a sprite image to UI button and scale it properly, scale button unity, unity UI, scale unity UI properly, button corners not rounded unity, rounded buttons corners unity, buttons corners distorted unity, buttons corners deformed unity, scale UI without deformation unity, scale UI button correctly unity, learn unity fast, unity tutorial, how to make games with unity, unity how to make game, unity how to make 2d game, not as good as brackeys but good as well.
Рекомендации по теме
Комментарии
Автор

My left ear really enjoyed this
Edit: this was actually really helpful!

Coltic
Автор

Not what I was looking for, but what I needed :)

rancorjoy
Автор

Great content! Very clear and quick explanation!!! Thanks.

liltechnomancer
Автор

Thank you so much.. I was searching for this only.. Thanks a lot

smithabhishekkumar
Автор

Yep. Big help. Thank you Alexander Zotov.

LexGear
Автор

Thank you so much for this video. That's what i was searching for.

jackunlocker
Автор

Thanks! This was exactly what I was looking for. Would you happen to know if there is a way to make the edges scale by tiling repeatedly instead of stretching? Something like having a border pattern?

_zurr
Автор

THANK YOU! I searched for this so long!

centigames
Автор

just not happy the voice is only from left

anonanon
Автор

my button just shows as grey, it is not showing properly, how do I fix this?

vfhgeve
Автор

For some reason, this doesn;t work form me in unity 2019.3.1f1 is that possible? It seems like center is ignored and I'm scaling just corners improperly. Also, how to turn on those ble dots to allow size/position adjustments in scene windows? Those are not shown as well... Thanks for the answers (maybe Im just dumb)

milda
Автор

hello sir i am working on 2d fish game i want to add many enemies in second level i have create array of enemy list and add prefabs enemy this is the script using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class enemyGenerateScript : MonoBehaviour {

private Transform enemyPrefab;
public GameObject[] enemyPrefabs;
//private double i = 0;
//private double j = 0;

void Start ()
{
enemyPrefabs =

for(int i = 0; i < enemyPrefabs.Length; i++)
{
Debug.Log("enemyPrefabs Number "+i+" is named "+enemyPrefabs[i].name);
}}

void Update()
{
//i = Time.realtimeSinceStartup;

//if ((i-j)>1)
{
var enemyTransform = Instantiate(enemyPrefab) as Transform;

enemyTransform.position = new Vector3(15, Random.Range (-4, 4), -2);
//j = i;
}

}

}

but the problem is that when i play the game is generate an error
ArgumentException: The Object you want to instantiate is null.
(System.Object arg, System.String message) (at
(UnityEngine.Transform original) (at
enemyGenerateScript.Update () (at

please sir help to me.

muhammadfahad