Example #1
0
        public void Load()
        {
            // Load textures
            if (effectTextures == null)
            {
                effectTextures = new Texture[EffectTextureFilenames.Length];
                for (int num = 0; num < effectTextures.Length; num++)
                {
                    effectTextures[num] = new Texture(EffectTextureFilenames[num]);
                } // for (num)
            } // if

            if (explosionTextures == null)
            {
                explosionTextures =
                    new AnimatedTexture[ExplosionTextureFilenames.Length];
                for (int num = 0; num < explosionTextures.Length; num++)
                {
                    explosionTextures[num] = new AnimatedTexture(
                        ExplosionTextureFilenames[num]);
                } // for (num)
            } // if
        }
Example #2
0
        /// <summary>
        /// Test textures
        /// </summary>
        public static void TestAnimatedTexture()
        {
            AnimatedTexture explosionTexture = null;
            TestGame.Start("TestAnimatedTexture",
                delegate
                {
                    explosionTexture = new AnimatedTexture("destroy");
                },
                delegate
                {
                    explosionTexture.Select((int)BaseGame.TotalTimeMs / 33);
                    int screenSize =
                        Math.Max(BaseGame.Width * 2 / 19, BaseGame.Height * 2 / 19);
                    explosionTexture.RenderOnScreen(new Rectangle(
                        BaseGame.Width / 2 - screenSize / 2,
                        BaseGame.Height / 2 - screenSize / 2,
                        screenSize, screenSize));

                    if (Input.MouseLeftButtonJustPressed)
                        Sound.Play(Sound.Sounds.Explosion);
                });
        }
Example #3
0
        /// <summary>
        /// Render
        /// </summary>
        /// <param name="tex">Tex</param>
        /// <param name="animationStep">Animation step</param>
        /// <param name="pos">Position</param>
        /// <param name="size">Size</param>
        /// <param name="rotation">Rotation</param>
        /// <param name="col">Color</param>
        public static void Render(AnimatedTexture tex, int animationStep,
			BlendMode lightBlendMode, Vector3 pos, float size, Color col)
        {
            Render(tex.GetAnimatedTexture(animationStep), lightBlendMode,
                pos, size, col);
        }