Exemplo n.º 1
0
        public void SetStartSize(IGraphicComponent component)
        {
            component.CheckNull("component");

            StartWidth = component.Width;
            StartHeight = component.Height;
        }
Exemplo n.º 2
0
 public void AddComponent(IGraphicComponent comp)
 {
     comp.CheckNull("comp");
     RegisterEventHandler(comp);
     components.Add(comp);
     Invalidate();
 }
Exemplo n.º 3
0
        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;
        }