Survivalcraft API 1.8.2.3 v1.8.2.3
Survivalcraft 2.4
载入中...
搜索中...
未找到
Subtexture.cs
浏览该文件的文档.
1using Engine;
3
4namespace Game {
5 public class Subtexture {
6 public readonly Texture2D Texture;
7
8 public readonly Vector2 TopLeft;
9
10 public readonly Vector2 BottomRight;
11
12 public Subtexture(Texture2D texture, Vector2 topLeft, Vector2 bottomRight) {
13 Texture = texture;
14 TopLeft = topLeft;
15 BottomRight = bottomRight;
16 }
17
18 public Subtexture(Texture2D texture) {
19 Texture = texture;
22 }
23
24 public static implicit operator Texture2D(Subtexture subtexture) => subtexture.Texture;
25
26 public static implicit operator Subtexture(Texture2D texture) => new(texture);
27 }
28}
readonly Texture2D Texture
Subtexture(Texture2D texture, Vector2 topLeft, Vector2 bottomRight)
readonly Vector2 BottomRight
readonly Vector2 TopLeft
Subtexture(Texture2D texture)
static readonly Vector2 Zero
static readonly Vector2 One