-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDisplayObjectContainer.cs
42 lines (36 loc) · 1001 Bytes
/
DisplayObjectContainer.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
using System.Collections.Generic;
using LuaInterface;
namespace Emmy.self_ui
{
public class DisplayObjectContainer : DisplayObject
{
private List<DisplayObject> _children;
public int NumChildren
{
get { return this._children.Count; }
}
public DisplayObjectContainer()
{
this._children = new List<DisplayObject>();
}
public DisplayObject AddChild(DisplayObject child)
{
this._children.Add(child);
child._parent = this;
this.isModi = true;
return child;
}
public void AddChildAt(DisplayObject child, int index)
{
this._children.Insert(index, child);
}
protected override void DoDraw()
{
int length = this._children.Count;
for (int i = 0; i < length; i++)
{
this._children[i].Draw();
}
}
}
}