public void SetStartSize(IGraphicComponent component) { component.CheckNull("component"); StartWidth = component.Width; StartHeight = component.Height; }
public void AddComponent(IGraphicComponent comp) { comp.CheckNull("comp"); RegisterEventHandler(comp); components.Add(comp); Invalidate(); }
public void Update(GameTime time, IGraphicComponent component) { component.CheckNull("component"); if (!IsInitialized) Init(); if (currentWidth.CompareTo(EndWidth) == 0 && currentHeight.CompareTo(EndHeight) == 0) Finished(); if (time.ElapsedGameTime.TotalMilliseconds.AlmostEqual(0)) return; if (shrinkX) currentWidth = Math.Max(currentWidth - SpeedX, EndWidth); else currentWidth = Math.Min(currentWidth + SpeedX, EndWidth); if (shrinkY) currentHeight = Math.Max(currentHeight - SpeedY, EndHeight); else currentHeight = Math.Max(currentWidth + SpeedY, EndHeight); component.Width = currentWidth; component.Height = currentHeight; }