Ejemplo n.º 1
0
        public override void setTransition(IMenuComponent component)
        {
            ICollectionComponent collection = component as ICollectionComponent;

            List <Vector2> newPositions = collection.Positions;
            List <Vector2> newOrigins   = collection.Origins;
            List <float>   newScales    = collection.Scales;

            for (int i = 0; i < collection.Scales.Count; i++)
            {
                if (toScale)
                {
                    newScales[i] -= factor;
                }

                newOrigins[i] = defaultOrigin;

                newPositions[i] += scaleOrigin;
            }

            collection.Positions = newPositions;
            collection.Origins   = newOrigins;
            collection.Scales    = newScales;

            base.setTransition(collection);
        }
Ejemplo n.º 2
0
        public override void dynamicInitialize()
        {
            ICollectionComponent list = components["Text List"] as ICollectionComponent;

            List <string> newText = new List <string>();

            newText.Add(GameManager.data.gameOverMessage);
            newText.Add("Score:");
            newText.Add(GameManager.data.score.ToString());
            newText.Add("Level:");
            newText.Add(GameManager.data.levelReached.ToString());
            newText.Add("Removed:");
            newText.Add(GameManager.data.rowsDeleted.ToString() + " Rows");
            newText.Add("Time:");

            if (GameManager.data.time.Seconds > 9)
            {
                newText.Add(GameManager.data.time.Minutes.ToString() + ":" + GameManager.data.time.Seconds.ToString());
            }
            else
            {
                newText.Add(GameManager.data.time.Minutes.ToString() + ":0" + GameManager.data.time.Seconds.ToString());
            }

            list.Texts = newText;
        }
Ejemplo n.º 3
0
        public override void setTransition(IMenuComponent component)
        {
            ICollectionComponent collection = component as ICollectionComponent;

            List <Color> newColors = collection.Colors;

            byte startAlpha = 0;

            if (direction > 0)
            {
                startAlpha = (byte)(255 - collection.Color.A);
            }
            else if (direction < 0)
            {
                startAlpha = collection.Color.A;
            }

            for (int i = 0; i < collection.Colors.Count; i++)
            {
                Color newColor = newColors[i];

                newColor.A = startAlpha;

                newColors[i] = newColor;
            }

            collection.Colors = newColors;

            base.setTransition(collection);
        }
Ejemplo n.º 4
0
        public override void initialize(IMenuComponent component)
        {
            ICollectionComponent collection = component as ICollectionComponent;

            defaultAlpha = collection.Colors[0].A;

            base.initialize(component);
        }
Ejemplo n.º 5
0
        public override void initialize(IMenuComponent component)
        {
            ICollectionComponent collection = component as ICollectionComponent;

            defaultScale = collection.Scales[0];

            defaultOrigin = collection.Origins[0];

            base.initialize(component);
        }
Ejemplo n.º 6
0
        public override void initialize(IMenuComponent component)
        {
            ICollectionComponent collection = component as ICollectionComponent;

            foreach (Vector2 position in collection.Positions)
            {
                defaultVectors.Add(position);
            }

            base.initialize(component);
        }
Ejemplo n.º 7
0
        public override void reset(IMenuComponent component)
        {
            ICollectionComponent collection = component as ICollectionComponent;

            List <Vector2> newPositions = collection.Positions;

            for (int i = 0; i < collection.Positions.Count; i++)
            {
                newPositions[i] = defaultVectors[i];
            }

            collection.Positions = newPositions;

            counter = 0;

            base.reset(component);
        }
Ejemplo n.º 8
0
        public override void setTransition(IMenuComponent component)
        {
            ICollectionComponent collection = component as ICollectionComponent;

            List <Vector2> newPositions = collection.Positions;

            if (toVector)
            {
                for (int i = 0; i < collection.Positions.Count; i++)
                {
                    newPositions[i] -= direction;
                }
            }

            collection.Positions = newPositions;

            base.setTransition(component);
        }
Ejemplo n.º 9
0
        public override void update(IMenuComponent component)
        {
            ICollectionComponent collection = component as ICollectionComponent;

            List <Vector2> newPositions = collection.Positions;

            if (counter < interval)
            {
                for (int i = 0; i < collection.Positions.Count; i++)
                {
                    newPositions[i] += direction / new Vector2(interval);
                }

                counter++;
            }

            collection.Positions = newPositions;

            base.update(component);
        }
Ejemplo n.º 10
0
        public override void reset(IMenuComponent component)
        {
            ICollectionComponent collection = component as ICollectionComponent;

            List <Color> newColors = collection.Colors;

            for (int i = 0; i < collection.Colors.Count; i++)
            {
                Color newColor = newColors[i];


                newColor.A = defaultAlpha;

                newColors[i] = newColor;
            }

            counter = 0;

            collection.Colors = newColors;

            base.reset(component);
        }
Ejemplo n.º 11
0
        public override void reset(IMenuComponent component)
        {
            ICollectionComponent collection = component as ICollectionComponent;

            List <Vector2> newPositions = collection.Positions;
            List <Vector2> newOrigins   = collection.Origins;
            List <float>   newScales    = collection.Scales;

            for (int i = 0; i < collection.Scales.Count; i++)
            {
                newScales[i]  = defaultScale;
                newOrigins[i] = defaultOrigin;

                newPositions[i] -= scaleOrigin;
            }

            counter = 0;

            collection.Positions = newPositions;
            collection.Origins   = newOrigins;
            collection.Scales    = newScales;

            base.reset(component);
        }
Ejemplo n.º 12
0
        public override void update(IMenuComponent component)
        {
            ICollectionComponent collection = component as ICollectionComponent;

            List <float> newScales = collection.Scales;

            if (counter < interval)
            {
                for (int i = 0; i < collection.Scales.Count; i++)
                {
                    float newScale = newScales[i];

                    newScale += (factor / (float)interval);

                    newScales[i] = newScale;
                }

                counter++;
            }

            collection.Scales = newScales;

            base.update(component);
        }
Ejemplo n.º 13
0
        public override void update(IMenuComponent component)
        {
            ICollectionComponent collection = component as ICollectionComponent;

            List <Color> newColors = collection.Colors;

            if (counter < interval)
            {
                for (int i = 0; i < collection.Colors.Count; i++)
                {
                    Color newColor = newColors[i];

                    newColor.A += (byte)((255 / interval) * direction);

                    newColors[i] = newColor;
                }

                counter++;
            }

            collection.Colors = newColors;

            base.update(component);
        }