2D ゲームプレイにおけるスプライトオブジェクトを示します
Sprite とはキャラクター、アイテム、発射物や他の 2D ゲーム要素として使用される 2D グラフィックスオブジェクトです。グラフィックスはビットマップ、すなわち Texture2D から適用します。Sprite クラスは特定のスプライトで用いられるべきテクスチャ内の一部分を示します。この情報は GameObject 上の SpriteRenderer で使用して実際にグラフィックスを表示できます。
関連項目: SpriteRenderer クラス
associatedAlphaSplitTexture | 元テクスチャ由来のアルファチャンネルを含んでいるテクスチャを返します。 Unity は、元データがアルファを持っているスプライトに対して、このテクスチャを内部で生成します。 ETC1 のような技法を使って、圧縮する必要があります。元スプライトに関連するアルファテクスチャがない場合は null を返します。これはスプライトが ETC1 圧縮を用いて設定されていない場合に起こります。 |
border | スプライトの境界の大きさを返します。 |
bounds | Bounds of the Sprite, specified by its center and extents in world space units. |
packed | スプライトがアトラスでパックされている場合、true を返します |
packingMode | スプライトがパックされている場合 ( Sprite.packed を参照)、SpritePackingMode を返します |
packingRotation | スプライトがパックされている場合 ( Sprite.packed を参照)、SpritePackingRotation を返します |
pivot | 元のテクスチャにおけるスプライトの位置をピクセルで示したもの |
pixelsPerUnit | ワールド空間座標の 1 単位分に相当する、スプライトのピクセル数 (Read Only) 。 |
rect | 元のテクスチャにおけるスプライトの位置をピクセルで示したもの |
texture | 使用されているテクスチャへの参照を取得します。パッキングされている場合はアトラスを示し、パッキングされていない場合は元スプライトを示します。 |
textureRect | このスプライトに使用されているテクスチャの矩形を取得します。このスプライトがアトラスにタイトに詰められている場合は、除外されます。 |
textureRectOffset | このスプライトがテクスチャ上で使用している、元のスプライトの境界に対する矩形のずれを取得します。スプライトのメッシュタイプが FullRect の場合 0 を返します。 |
triangles | スプライトメッシュの三角形を持つ配列のコピーを返します。 |
uv | スプライトメッシュの基底テクスチャ座標 |
vertices | スプライトメッシュの頂点位置を持つ配列のコピーを返します。 |
GetPhysicsShape | Gets a physics shape from the Sprite by its index. |
GetPhysicsShapeCount | The number of physics shapes for the Sprite. |
GetPhysicsShapePointCount | The number of points in the selected physics shape for the Sprite. |
OverrideGeometry | Sprite オブジェクトを新規に作成します |
OverridePhysicsShape | Sets up a new Sprite physics shape. |
Create | Sprite オブジェクトを新規に作成します |
hideFlags | Should the object be hidden, saved with the Scene or modifiable by the user? |
name | オブジェクト名 |
GetInstanceID | オブジェクトのインスタンス ID を返します |
ToString | Returns the name of the object. |
Destroy | Removes a GameObject, component or asset. |
DestroyImmediate | Destroys the object obj immediately. You are strongly recommended to use Destroy instead. |
DontDestroyOnLoad | Do not destroy the target Object when loading a new Scene. |
FindObjectOfType | タイプ type から最初に見つけたアクティブのオブジェクトを返します |
FindObjectsOfType | タイプから見つけたすべてのアクティブのオブジェクト配列を返します |
Instantiate | original のオブジェクトをクローンします |
bool | オブジェクトが存在するかどうか |
operator != | 二つのオブジェクトが異なるオブジェクトを参照しているか比較します |
operator == | 2つのオブジェクト参照が同じオブジェクトを参照しているか比較します。 |
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.