Survivalcraft API 1.8.2.3 v1.8.2.3
Survivalcraft 2.4
载入中...
搜索中...
未找到
ClearWidget.cs
浏览该文件的文档.
1using Engine;
3
4namespace Game {
5 public class ClearWidget : Widget {
6 public Color Color { get; set; }
7
8 public float Depth { get; set; }
9
10 public int Stencil { get; set; }
11
12 public bool ClearColor { get; set; }
13
14 public bool ClearDepth { get; set; }
15
16 public bool ClearStencil { get; set; }
17
18 public ClearWidget() {
19 ClearColor = true;
20 ClearDepth = true;
21 ClearStencil = true;
22 Color = Color.Black;
23 Depth = 1f;
24 Stencil = 0;
25 IsHitTestVisible = false;
26 }
27
28 public override void MeasureOverride(Vector2 parentAvailableSize) {
29 IsDrawRequired = true;
30 }
31
32 public override void Draw(DrawContext dc) {
34 ClearColor ? new Vector4?(new Vector4(Color)) : null,
35 ClearDepth ? new float?(Depth) : null,
36 ClearStencil ? new int?(Stencil) : null
37 );
38 }
39 }
40}
static void Clear(Vector4? color, float? depth=null, int? stencil=null)
override void Draw(DrawContext dc)
override void MeasureOverride(Vector2 parentAvailableSize)
bool IsDrawRequired
virtual bool IsHitTestVisible