internal void Add(UIVisibleObject obj) { obj.Parent = this; for (int i = 0; i < children.Count; i++) { if (children[i].Layer > obj.Layer) { children.Insert(i, obj); return; } } children.Add(obj); }
private void SnapCam() { snaptarget = null; float intersize = 0; foreach (UIVisibleObject cell in cells) { if (cell.LocalBoundingBox.Intersects(cam.TargetView)) { float cis = cell.LocalBoundingBox.Intersection(cam.TargetView).Area; if (cis > intersize) { intersize = cis; snaptarget = cell; } } } if (snaptarget != null) { cam.EnsureVisible(snaptarget.LocalBoundingBox); } }
internal void Remove(UIVisibleObject obj) { children.Remove(obj); obj.Parent = null; }
private void SnapCam() { snaptarget = null; float intersize = 0; foreach (UIVisibleObject cell in cells) { if (cell.LocalBoundingBox.Intersects(cam.TargetView)) { float cis = cell.LocalBoundingBox.Intersection(cam.TargetView).Area; if (cis > intersize) { intersize = cis; snaptarget = cell; } } } if (snaptarget != null) cam.EnsureVisible(snaptarget.LocalBoundingBox); }