SpriteLayer
اعلان
public class Strawberry.Graphics.Layers.SpriteLayer
لایهای مسئول batching و رندر چهرهها (Sprite) درون یک صحنه.
ارثبری از: Strawberry.Graphics.Layers.Layer
سازندهها
SpriteLayer
void SpriteLayer()
SpriteLayer
void SpriteLayer(int maxBatchCount)
پارامترها:
| نام | نوع | توضیحات |
|---|---|---|
maxBatchCount |
System.Int32 |
ویژگیها
ActiveShader
شِیدِر (Shader) فعال فعلی استفادهشده برای رندر چهره را دریافت میکند.
BasicShader ActiveShader { get }
GraphicsContext
کانتکست گرافیکی صحنهی فعلی را دریافت میکند.
IGraphicsContext GraphicsContext { get }
DrawCalls
تعداد draw call های انجامشده در آخرین pass رندر را دریافت یا تنظیم میکند.
int DrawCalls { get set }
متدها
Initialize override
لایهی چهره را مقداردهی اولیه کرده و منابع رندر را تخصیص میدهد.
void Initialize(Scene scene)
پارامترها:
| نام | نوع | توضیحات |
|---|---|---|
scene |
Strawberry.Core.Scene |
SetShader
void SetShader(BasicShader shader)
پارامترها:
| نام | نوع | توضیحات |
|---|---|---|
shader |
Strawberry.Graphics.BasicShader |
ResetShader
void ResetShader()
SetBlendMode
void SetBlendMode(string name)
پارامترها:
| نام | نوع | توضیحات |
|---|---|---|
name |
System.String |
GetQuad
SpriteQuad GetQuad(Sprite sprite, Vector2 position, Vector2 origin, Vector2 scale, Color color, int imageIndex, float angle)
پارامترها:
| نام | نوع | توضیحات |
|---|---|---|
sprite |
Strawberry.Graphics.Sprite |
|
position |
Strawberry.Math.Vector2 |
|
origin |
Strawberry.Math.Vector2 |
|
scale |
Strawberry.Math.Vector2 |
|
color |
Strawberry.Graphics.Color |
|
imageIndex |
System.Int32 |
|
angle |
System.Single |
Push
void Push(Sprite sprite, Vector2 position, Vector2 origin, Vector2 scale, Color color, int imageIndex, float angle)
پارامترها:
| نام | نوع | توضیحات |
|---|---|---|
sprite |
Strawberry.Graphics.Sprite |
|
position |
Strawberry.Math.Vector2 |
|
origin |
Strawberry.Math.Vector2 |
|
scale |
Strawberry.Math.Vector2 |
|
color |
Strawberry.Graphics.Color |
|
imageIndex |
System.Int32 |
|
angle |
System.Single |
Push
void Push(Texture texture, Vector2 position, Vector2 texSize, Vector2 size, Vector2 topLeft, Color color)
پارامترها:
| نام | نوع | توضیحات |
|---|---|---|
texture |
Strawberry.Graphics.Texture |
|
position |
Strawberry.Math.Vector2 |
|
texSize |
Strawberry.Math.Vector2 |
|
size |
Strawberry.Math.Vector2 |
|
topLeft |
Strawberry.Math.Vector2 |
|
color |
Strawberry.Graphics.Color |
Render override
void Render()
DrawOutlineRectangle
void DrawOutlineRectangle(RotatedRectangle rect, Color color)
پارامترها:
| نام | نوع | توضیحات |
|---|---|---|
rect |
Strawberry.Common.RotatedRectangle |
|
color |
Strawberry.Graphics.Color |
DrawRectangle
void DrawRectangle(RotatedRectangle rect, Color color)
پارامترها:
| نام | نوع | توضیحات |
|---|---|---|
rect |
Strawberry.Common.RotatedRectangle |
|
color |
Strawberry.Graphics.Color |
DrawHorizontalLine
void DrawHorizontalLine(Vector2 start, float length, Color color)
پارامترها:
| نام | نوع | توضیحات |
|---|---|---|
start |
Strawberry.Math.Vector2 |
|
length |
System.Single |
|
color |
Strawberry.Graphics.Color |
DrawVerticalLine
void DrawVerticalLine(Vector2 start, float length, Color color)
پارامترها:
| نام | نوع | توضیحات |
|---|---|---|
start |
Strawberry.Math.Vector2 |
|
length |
System.Single |
|
color |
Strawberry.Graphics.Color |
PushString
Vector2 PushString(string text, Font font, Vector2 position, Color color, TextDirection direction)
پارامترها:
| نام | نوع | توضیحات |
|---|---|---|
text |
System.String |
|
font |
Strawberry.Graphics.Text.Font |
|
position |
Strawberry.Math.Vector2 |
|
color |
Strawberry.Graphics.Color |
|
direction |
Strawberry.Graphics.Text.TextDirection |
PushString
Vector2 PushString(string text, Font font, Vector2 position, Color color, TextDirection direction, float size)
پارامترها:
| نام | نوع | توضیحات |
|---|---|---|
text |
System.String |
|
font |
Strawberry.Graphics.Text.Font |
|
position |
Strawberry.Math.Vector2 |
|
color |
Strawberry.Graphics.Color |
|
direction |
Strawberry.Graphics.Text.TextDirection |
|
size |
System.Single |