Example #1
0
		/// <summary>
		/// Changes the active Animation to one in a different AnimationManager.
		/// </summary>
		/// <param name="animations">The AnimationManager to get the new Animation out of.</param>
		/// <param name="animationnumber">The number of the new Animation.</param>
		/// <param name="elementnumber">The index of the starting element of the new Animation.</param>
		/// <returns>true if the requested Animation is set; false otherwise.</returns>
		public Boolean SetForeignAnimation(AnimationManager animations, Int32 animationnumber, Int32 elementnumber)
		{
			if (animations == null) throw new ArgumentNullException("animations");

			if (animations.HasAnimation(animationnumber) == false) return false;

			Animation animation = animations.m_animations[animationnumber];
			if (elementnumber < 0 || elementnumber >= animation.Elements.Count) return false;

			m_foreignanimation = true;
			SetAnimation(animation, animation.Elements[elementnumber]);
			return true;
		}
Example #2
0
        protected override void Initialize()
        {
            m_subsystems = new SubSystems(this);
            m_subsystems.GetSubSystem<IO.FileSystem>().Initialize();
            m_subsystems.GetSubSystem<InitializationSettings>().Initialize();
            m_subsystems.GetSubSystem<Input.InputSystem>().Initialize();
            m_subsystems.GetSubSystem<Video.VideoSystem>().Initialize();

            //m_font = m_subsystems.GetSubSystem<Drawing.SpriteSystem>().LoadFont(@"font/num1.fnt");
            //m_sprites = m_subsystems.GetSubSystem<Drawing.SpriteSystem>().CreateManager(@"chars/BuraiYamamoto/Burai.sff");
            //m_animations = m_subsystems.GetSubSystem<Animations.AnimationSystem>().CreateManager(@"chars/BuraiYamamoto/Burai.air");

            m_sprites = m_subsystems.GetSubSystem<Drawing.SpriteSystem>().CreateManager(@"chars/kfm/kfm.sff");
            m_animations = m_subsystems.GetSubSystem<Animations.AnimationSystem>().CreateManager(@"chars/kfm/kfm.air");

            m_animations.SetLocalAnimation(0, 0);
            m_sprites.LoadSprites(m_animations.CurrentAnimation);

            m_subsystems.GetSubSystem<Input.InputSystem>().CurrentInput[0].Add(SystemButton.DebugDraw, this.Click);

            base.Initialize();
        }
Example #3
0
        /// <summary>
        /// Changes the active Animation to one in a different AnimationManager.
        /// </summary>
        /// <param name="animations">The AnimationManager to get the new Animation out of.</param>
        /// <param name="animationnumber">The number of the new Animation.</param>
        /// <param name="elementnumber">The index of the starting element of the new Animation.</param>
        /// <returns>true if the requested Animation is set; false otherwise.</returns>
        public bool SetForeignAnimation(AnimationManager animations, int animationnumber, int elementnumber)
        {
            if (animations == null)
            {
                throw new ArgumentNullException(nameof(animations));
            }

            if (animations.HasAnimation(animationnumber) == false)
            {
                return(false);
            }

            var animation = animations.m_animations[animationnumber];

            if (elementnumber < 0 || elementnumber >= animation.Elements.Count)
            {
                return(false);
            }

            m_foreignanimation = true;
            SetAnimation(animation, animation.Elements[elementnumber]);
            return(true);
        }
Example #4
0
        /// <summary>
        /// Changes the active Animation to one in a different AnimationManager.
        /// </summary>
        /// <param name="animations">The AnimationManager to get the new Animation out of.</param>
        /// <param name="animationnumber">The number of the new Animation.</param>
        /// <param name="elementnumber">The index of the starting element of the new Animation.</param>
        /// <returns>true if the requested Animation is set; false otherwise.</returns>
        public Boolean SetForeignAnimation(AnimationManager animations, Int32 animationnumber, Int32 elementnumber)
        {
            if (animations == null)
            {
                throw new ArgumentNullException("animations");
            }

            if (animations.HasAnimation(animationnumber) == false)
            {
                return(false);
            }

            Animation animation = animations.m_animations[animationnumber];

            if (elementnumber < 0 || elementnumber >= animation.Elements.Count)
            {
                return(false);
            }

            m_foreignanimation = true;
            SetAnimation(animation, animation.Elements[elementnumber]);
            return(true);
        }