Sprite
اعلان
public class Strawberry.Graphics.Sprite
نمایانگر یک چهره (Sprite) دوبعدی با نگاشت تکسچر و اطلاعات فریم.
ارثبری از: Strawberry.ReferenceObject
سازندهها
Sprite
void Sprite(Texture texture, int imageCount, Vector2 size, Vector2 topLeft, Vector2 texSize, Vector2 skip)
پارامترها:
| نام | نوع | توضیحات |
|---|---|---|
texture |
Strawberry.Graphics.Texture |
|
imageCount |
System.Int32 |
|
size |
Strawberry.Math.Vector2 |
|
topLeft |
Strawberry.Math.Vector2 |
|
texSize |
Strawberry.Math.Vector2 |
|
skip |
Strawberry.Math.Vector2 |
Sprite
void Sprite(Texture texture, Vector2[] imageMap, Vector2 size, Vector2 texSize)
پارامترها:
| نام | نوع | توضیحات |
|---|---|---|
texture |
Strawberry.Graphics.Texture |
|
imageMap |
Strawberry.Math.Vector2[] |
|
size |
Strawberry.Math.Vector2 |
|
texSize |
Strawberry.Math.Vector2 |
ویژگیها
Position
Vector2 Position { get set }
Texture
تکسچری که این چهره برای رندر از آن استفاده میکند را دریافت یا تنظیم میکند.
Texture Texture { get set }
ImageCount
تعداد تصاویر یا فریمها در sprite sheet چهره را دریافت میکند.
int ImageCount { get }
TopLeft
مختصات گوشهی بالا-چپ چهره درون تکسچر را دریافت میکند.
Vector2 TopLeft { get }
TexSize
عرض و ارتفاع چهره درون تکسچر را دریافت میکند.
Vector2 TexSize { get }
Skip
تعداد پیکسلهایی که بین هر فریم در sprite sheet باید رد شود را دریافت میکند.
Vector2 Skip { get }
Size
اندازهی واقعی چهره در فضای دوبعدی را دریافت یا تنظیم میکند.
Vector2 Size { get set }
FrameMap
موقعیتهای هر فریم در sprite sheet را نسبت به گوشهی بالا-چپ دریافت میکند.
List<Vector2> FrameMap { get set }
متدها
ReInitialize
void ReInitialize(Texture texture, Vector2[] imageMap, Vector2 size, Vector2 texSize)
پارامترها:
| نام | نوع | توضیحات |
|---|---|---|
texture |
Strawberry.Graphics.Texture |
|
imageMap |
Strawberry.Math.Vector2[] |
|
size |
Strawberry.Math.Vector2 |
|
texSize |
Strawberry.Math.Vector2 |