Exemplo n.º 1
0
        public void setUpActionDefenition( SpriteGlobals.spriteDirections direction, SpriteGlobals.spriteActions action, AnimationDefenition actionDefenition  )
        {
            // Start setUpActionDefenition.

            _spriteAnimationList[ (int)direction, (int)action ] = actionDefenition;
        }
Exemplo n.º 2
0
        public void setUp( string spriteName, int numberOfDirections = 0, int numberOfActions = 0, bool isSavable = false, string SavePathAndName = null )
        {
            //Start setUp.

            _spriteName = spriteName;
            _saveable = isSavable;
            _savePathAndName = SavePathAndName;

            if( numberOfDirections == 0 && numberOfActions == 0 )
                _spriteAnimationList = new AnimationDefenition[ SpriteGlobals.numberOfDirections, SpriteGlobals.numberOfActions ];

            else if( numberOfDirections == 0 && numberOfActions != 0 )
                _spriteAnimationList = new AnimationDefenition[ SpriteGlobals.numberOfDirections, numberOfActions ];

            else if( numberOfDirections != 0 && numberOfActions == 0 )
                _spriteAnimationList = new AnimationDefenition[ numberOfDirections, SpriteGlobals.numberOfActions ];

            else
                _spriteAnimationList = new AnimationDefenition[ numberOfDirections, numberOfActions ];

            // Getting the size of the arrays:
            directionCount = _spriteAnimationList.GetLength(0);
            actionCount = _spriteAnimationList.GetLength(1);

            // Initializing the objects in the arrays:
            for ( i = 0; i < directionCount; i++)
            {
                for (j = 0; j < actionCount; j++ )
                {
                    _spriteAnimationList[i, j] = new AnimationDefenition();
                }
            }
        }