最大 4 色のグラデーションをテキストに適用できます。カラーグラデーションを加えると、TextCore によってテキスト文字列の各文字にグラデーションカラーが適用されます。
テキストオブジェクトにカラーグラデーションプリセットを適用するには、<gradient>
リッチテキストタグを を使用してください。グラデーションプリセットは、テキストのローカルのグラデーションタイプと色をオーバーライドします。
1 つまたは複数の色でカラーグラデーションを作成し、特定のフォルダーに配置するには、以下の手順を行います。
メニューから Assets > Create > Text > Color Gradient の順に選択し、新しいカラーグラデーションプリセットを加えます。
カラーグラデーションの Inspector ウィンドウで、ドロップダウンメニューからカラーモードを選択します。
グラデーションの色を設定します。Colorsフィールドで使用可能な色の数は、選択したグラデーションモードによって異なります。各スウォッチは、文字スプライト上の色の原点に対応しています。
カラーグラデーションアセットを、Panel Text Setting アセット のColor Gradient Presets に設定されたパスに配置します。
カラーグラデーションプリセットをテキストに適用するには、<gradient="name-of-the-color-gradient">テキスト</gradient>
のように、カラーグラデーションを名前で参照します。このようにカラーグラデーションを適用すると、テキストの色にオブジェクトの現在の頂点色が乗算されます。
純粋なグラデーションをテキストの選択範囲に適用するには、以下の例のように <color>
タグを使って色を白にリセットします。
<color=white><gradient="Light to Dark Green - Vertical">ライトグリーンからダークグリーンへのグラデーション</gradient></color>
以下に各モードのカラーグラデーションの例を示します。
単色のグラデーション。
2 色による左右のグラデーション。
2 色による上下のグラデーション。
4 色のグラデーション。各色は 1 つの角から放射状に広がります。最も用途の多いグラデーションタイプです。いくつかの色を変化させ、他の色を変化なしにするなど、さまざまな種類のグラデーションを作ることができます。
この例では、3 つの角が 1 つの色で、4 つ目の角が異なる色で色づけられています。
この例では、同じ色で隣接する角のペアで、左右または上下のグラデーションを示しています。
この例では、斜めに対向する角のペアを同じ色にして、斜めのグラデーションを作っています。
この例では、一方の端に支配的な色を置き、もう一方の端に 2 色間の変化を持つ左右および上下の 3 色グラデーションを示します。
この例では、斜めに対向する 2 つの角に同じ色を、残りの 2 つの角に異なる色を使い、斜めのストライプの 3 色グラデーションを作ります。
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.