private void updateItems(float dtime) { List <string> remove = new List <string>(); float y = Size.Y; foreach (var itemPair in items) { ProfilerItem item = itemPair.Value; if (item.Active) { float dy = (y - item.Size.Y - item.Pos.Y); if (Math.Abs(dy) < 2) { item.Pos.Y = y - item.Size.Y; } else { item.Pos.Y += dy * 10 * dtime; } y -= 6 + item.Size.Y; } else { remove.Add(itemPair.Key); } } foreach (string key in remove) { RemoveChild(items[key]); items.Remove(key); } }
public void Begin(string name, bool adapt = true, float scale = 500) { if (!Visible) { return; } if (!items.ContainsKey(name)) { ProfilerItem item = new ProfilerItem(new Vector2(Size.X, 60), name, adapt, scale); AddChild(item); items.Add(name, item); } items[name].Start(); }