/// <summary> /// If and only if <see cref="ManualTouchOrder"/> is set to <c>false</c> (by default it is) /// the touch order is calculated based on both <see pref="Transform2D.DrawOrder"/> and /// the <see cref="RenderLayer"/> used. /// </summary> public void UpdateTouchOrder() { if (!this.ManualTouchOrder && this.Owner != null) { int order = 0; int numberOfLevels = 100; Drawable2D drawable2D = this.Owner.FindComponent <Drawable2D>(false); if (drawable2D != null) { int layer = drawable2D.LayerId; int index = this.RenderManager.GetLayerIndex(layer); if (index != -1) { order = index * numberOfLevels; } } if (this.Transform2D != null) { order += (int)((1 - this.Transform2D.DrawOrder) * numberOfLevels); } this.TouchOrder = order; } }
public void Add(Drawable2D d) { drawables2D.Add(d); }