facebook twitter hatena line email

「Unity/角丸ボタン」の版間の差分

提供: 初心者エンジニアの簡易メモ
移動: 案内検索
(shapes2dをインストール)
(ボタンの色を変更)
行15: 行15:
  
 
==ボタンの色を変更==
 
==ボタンの色を変更==
 +
#ShapeのFillTypeをSolidColorへ変更
 
#ShapeのFill Colorを選択する
 
#ShapeのFill Colorを選択する
 +
 +
==背景画像入ボタンへ変更==
 +
#ShapeのFillTypeをTextureへ変更
 +
#FillTextureに画像を入れる
  
 
==参考==
 
==参考==
 
https://note.com/hikohiro/n/n9100eae28208
 
https://note.com/hikohiro/n/n9100eae28208

2021年7月30日 (金) 00:12時点における版

角丸ボタンを作る

shapes2dをインストール

assetstoreからinstallする

https://assetstore.unity.com/packages/tools/sprite-management/shapes2d-procedural-sprites-and-ui-62586

作れるサンプル確認

Shapes2D/Demos/Showcase/Showcase.unityを選択して確認。

作り方

  1. 適当なUI/Buttonを設置する
  2. ボタンのinspectorのAddComponentからShapeを追加する
  3. Roundnessにボタンの高さの半分を入力すればできる

ボタンの色を変更

  1. ShapeのFillTypeをSolidColorへ変更
  2. ShapeのFill Colorを選択する

背景画像入ボタンへ変更

  1. ShapeのFillTypeをTextureへ変更
  2. FillTextureに画像を入れる

参考

https://note.com/hikohiro/n/n9100eae28208