GUI 要素のスタイル情報
ほとんどの GUI 関数はデフォルトのスタイルを上書きするオプションの GUIStyle パラメーターを受け入れます。これにより、色、フォントやその他の詳細を変更していろいろな状態に切り替えます (例えばマウスがコントロールの上にあるとき)。全体の GUI 設計に一貫したルックアンドフィールが必要な場所で GUISkin クラスは GUIStyle を設定するセットを収集し、それらを一度にすべてを適用するために便利な方法です。
none | 空の GUIStyle のショートカット |
active | コントロールが押されたときのレンダリング設定 |
alignment | テキストの配置 |
border | すべての背景画像の境界線 |
clipping | 表示されるコンテンツが指定した範囲内に収まるには大きすぎるとき、何をするか。 |
contentOffset | この GUIstyle のコンテンツに適用する Pixel Offset |
fixedHeight | 0 以外の場合、このスタイルで表示される任意の GUI 要素はここで指定した高さを持ちます。 |
fixedWidth | 0 以外の場合、このスタイルで表示される任意の GUI 要素はここで指定した幅を持ちます。 |
focused | 要素にキーボードフォーカスがあるときのレンダリング設定 |
font | 表示に使用するフォントです。 null の場合、現在の GUISkin のデフォルトのフォントが代わりに使われます。 |
fontSize | フォントのサイズ(ダイナミックフォント用) |
fontStyle | フォントスタイル(ダイナミックフォント用) |
hover | マウスがコントロールの上にあるときのレンダリング設定 |
imagePosition | どのように GUIContent のイメージとテキストを組み合わせるか。 |
lineHeight | このスタイルではテキストの 1 行の高さをピクセル単位で測ります。(Read Only) |
margin | このスタイルでレンダリングされる要素とその他の GUI 要素間の余白 |
name | この GUIStyle の名前です。名前に基づいてそれらを取得するために使用されます。 |
normal | コンポーネントが正常に表示されたときのレンダリング設定 |
onActive | 要素がオンになり、押されたときのレンダリング設定 |
onFocused | 要素がキーボードを持ち、オンになったときのレンダリング設定 |
onHover | コントロールがオンになりマウスがその上にあるときのレンダリング設定 |
onNormal | コントロールがオンになったときのレンダリング設定 |
overflow | 背景画像に追加される余分な空白。 |
padding | コンテンツの始まりから GUIStyle の端までのスペース |
richText | テキスト形式マークアップで HTML-style タグが使用可能になる。 |
stretchHeight | レイアウトをよくするためにこのスタイルの GUI 要素を垂直方向に伸縮することができるか。 |
stretchWidth | レイアウトをよくするためにこのスタイルの GUI 要素を水平方向に伸縮することができるか。 |
wordWrap | テキストは折り返しする必要があるか。 |
GUIStyle | 空の GUIStyle のコンストラクター |
CalcHeight | 表示する content と指定する width によって決まる高さを計算して取得します |
CalcMinMaxWidth | コンテンツを描画するこのスタイルの最小と最大の幅を計算します。 |
CalcScreenSize | このスタイルでフォーマットされる要素のサイズとコンテンツに与えられる空間を計算します。 |
CalcSize | Calculate the size of some content if it is rendered with this style. |
Draw | スクリーン上にこの GUIStyle を描画します。内部バージョンです。 |
DrawCursor | 文字入力の際に表示されるカーソルを描画します |
DrawWithTextSelection | 文字入力の際に表示されるカーソルを描画します |
GetCursorPixelPosition | 文字列のインデックスを指定し、ピクセル単位の位置を返します |
GetCursorStringIndex | ユーザーが cursorPixelPosition でクリックしたとき、(Contents.text 内にインデックスする) カーソルの位置を取得します。 |
GUIStyle | 現在のスキンから名前付きの GUI スタイルを取得します。 |
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.