Example #1
0
        public void SetRenderPara()
        {
            this.DeviceMain.Clear(ClearFlags.Target, (Color4)this.FogColor, 0.0f, 0);
            this.SpriteMain.Begin(SpriteFlags.AlphaBlend);
            MySprite      spriteMain    = this.SpriteMain;
            TextureObject textureObject = this.StageData.TextureObjectDictionary["BG01a"];
            Rectangle     boundRect     = this.BoundRect;
            double        num1          = (double)(boundRect.Left + 256);

            boundRect = this.BoundRect;
            double num2     = (double)(boundRect.Top + 256);
            PointF position = new PointF((float)num1, (float)num2);
            Color  white    = Color.White;

            spriteMain.Draw2D(textureObject, 1f, 0.0f, position, white);
            this.SpriteMain.End();
            this.DeviceMain.SetRenderState(RenderState.ZEnable, false);
            this.DeviceMain.SetRenderState(RenderState.CullMode, true);
            this.DeviceMain.SetRenderState(RenderState.AlphaBlendEnable, true);
            this.DeviceMain.SetRenderState <Blend>(RenderState.SourceBlend, Blend.SourceAlpha);
            this.DeviceMain.SetRenderState <Blend>(RenderState.DestinationBlend, Blend.InverseSourceAlpha);
            this.DeviceMain.SetTextureStageState(0, TextureStage.AlphaArg1, TextureArgument.Texture);
            this.DeviceMain.SetTextureStageState(0, TextureStage.AlphaOperation, TextureOperation.Modulate);
            this.DeviceMain.SetTextureStageState(0, TextureStage.AlphaArg2, TextureArgument.Diffuse);
            this.DeviceMain.SetTransform(TransformState.View, Matrix.LookAtLH(this.CameraPosition, this.CameraTarget, this.CameraDirection));
            this.DeviceMain.SetTransform(TransformState.Projection, Matrix.PerspectiveFovLH(1.570796f, 1f, 1f, this.FogEnd + 200f));
            this.DeviceMain.SetRenderState(RenderState.FogEnable, true);
            this.DeviceMain.SetRenderState <FogMode>(RenderState.FogTableMode, FogMode.Linear);
            this.DeviceMain.SetRenderState(RenderState.FogColor, this.FogColor.ToArgb());
            this.DeviceMain.SetRenderState(RenderState.FogStart, this.FogStart);
            this.DeviceMain.SetRenderState(RenderState.FogEnd, this.FogEnd);
            this.DeviceMain.SetLight(0, this.light);
            this.DeviceMain.SetRenderState(RenderState.Lighting, true);
            this.DeviceMain.EnableLight(0, true);
        }
Example #2
0
        public override void Show()
        {
            int       num1       = TimeMain % 8 * 8;
            SizeF     sizeF      = new SizeF((TxtureObject.Width - 64) * ScaleWidth, TxtureObject.Height * ScaleLength);
            MySprite  spriteMain = SpriteMain;
            Texture   txTure     = TxtureObject.TXTure;
            Rectangle posRect    = TxtureObject.PosRect;
            int       x          = posRect.X + 64 - num1;

            posRect = TxtureObject.PosRect;
            int y = posRect.Y;

            posRect = TxtureObject.PosRect;
            int width = posRect.Width - 64;

            posRect = TxtureObject.PosRect;
            int       height          = posRect.Height;
            Rectangle srcRectangle    = new Rectangle(x, y, width, height);
            SizeF     destinationSize = sizeF;
            PointF    rotationCenter  = new PointF((TxtureObject.Width - 64) / 2, TxtureObject.Height / 2);
            double    num2            = Direction - Math.PI / 2.0 + Angle;
            PointF    position        = Position;
            Color     color           = Color.FromArgb(TransparentValue, ColorValue);

            spriteMain.Draw2D(txTure, srcRectangle, destinationSize, rotationCenter, (float)num2, position, color);
        }
Example #3
0
        public void SetRenderPara()
        {
            this.DeviceMain.Clear(ClearFlags.ZBuffer | ClearFlags.Target, (Color4)this.FogColor, 1f, 0);
            this.SpriteMain.Begin(SpriteFlags.AlphaBlend);
            MySprite      spriteMain1    = this.SpriteMain;
            TextureObject textureObject1 = this.StageData.TextureObjectDictionary["夜空底色"];
            Rectangle     boundRect1     = this.BoundRect;
            double        num1           = (double)(boundRect1.Left + 205);

            boundRect1 = this.BoundRect;
            double num2      = (double)(boundRect1.Top + 240);
            PointF position1 = new PointF((float)num1, (float)num2);
            Color  white     = Color.White;

            spriteMain1.Draw2D(textureObject1, 1f, 0.0f, position1, white);
            MySprite      spriteMain2    = this.SpriteMain;
            TextureObject textureObject2 = this.StageData.TextureObjectDictionary["星星1"];
            Rectangle     boundRect2     = this.BoundRect;
            double        num3           = (double)(boundRect2.Left + 205);

            boundRect2 = this.BoundRect;
            double num4      = (double)(boundRect2.Top + 240);
            PointF position2 = new PointF((float)num3, (float)num4);
            Color  color1    = Color.FromArgb((int)(128.0 + (double)sbyte.MaxValue * Math.Sin((double)this.Time / 200.0 * 2.0 * Math.PI)), Color.White);

            spriteMain2.Draw2D(textureObject2, 1f, 0.0f, position2, color1);
            MySprite      spriteMain3    = this.SpriteMain;
            TextureObject textureObject3 = this.StageData.TextureObjectDictionary["星星2"];
            Rectangle     boundRect3     = this.BoundRect;
            double        num5           = (double)(boundRect3.Left + 205);

            boundRect3 = this.BoundRect;
            double num6      = (double)(boundRect3.Top + 240);
            PointF position3 = new PointF((float)num5, (float)num6);
            Color  color2    = Color.FromArgb((int)(128.0 - (double)sbyte.MaxValue * Math.Sin((double)this.Time / 200.0 * 2.0 * Math.PI)), Color.White);

            spriteMain3.Draw2D(textureObject3, 1f, 0.0f, position3, color2);
            this.SpriteMain.End();
            this.DeviceMain.SetRenderState(RenderState.ZEnable, true);
            this.DeviceMain.SetRenderState(RenderState.ZWriteEnable, true);
            this.DeviceMain.SetRenderState(RenderState.CullMode, true);
            this.DeviceMain.SetRenderState(RenderState.AlphaBlendEnable, true);
            this.DeviceMain.SetRenderState <Blend>(RenderState.SourceBlend, Blend.SourceAlpha);
            this.DeviceMain.SetRenderState <Blend>(RenderState.DestinationBlend, Blend.InverseSourceAlpha);
            this.DeviceMain.SetTextureStageState(0, TextureStage.AlphaArg1, TextureArgument.Texture);
            this.DeviceMain.SetTextureStageState(0, TextureStage.AlphaOperation, TextureOperation.Modulate);
            this.DeviceMain.SetTextureStageState(0, TextureStage.AlphaArg2, TextureArgument.Diffuse);
            this.DeviceMain.SetTransform(TransformState.View, Matrix.LookAtLH(this.CameraPosition, this.CameraTarget, this.CameraDirection));
            this.DeviceMain.SetTransform(TransformState.Projection, Matrix.PerspectiveFovLH(0.7853982f, 1f, 1f, this.FogEnd + 400f));
            this.DeviceMain.SetRenderState(RenderState.FogEnable, true);
            this.DeviceMain.SetRenderState <FogMode>(RenderState.FogTableMode, FogMode.Linear);
            this.DeviceMain.SetRenderState(RenderState.FogColor, this.FogColor.ToArgb());
            this.DeviceMain.SetRenderState(RenderState.FogStart, this.FogStart);
            this.DeviceMain.SetRenderState(RenderState.FogEnd, this.FogEnd);
            this.DeviceMain.SetLight(0, this.light);
            this.DeviceMain.SetRenderState(RenderState.Lighting, true);
            this.DeviceMain.EnableLight(0, true);
        }
Example #4
0
        public override void Show()
        {
            SizeF destinationSize1 = new SizeF((float)this.TxtureObject.Width, 116f);

            this.SpriteMain.Draw2D(this.TxtureObject.TXTure, this.TxtureObject.PosRect, destinationSize1, this.TxtureObject.LeftTop, 0.0f, this.Position, Color.FromArgb(this.TransparentValue, Color.White));
            if (this.Text == null || this.StringTexture == null)
            {
                return;
            }
            PointF position1;

            if (this.Shadowed)
            {
                MySprite  spriteMain       = this.SpriteMain;
                Texture   stringTexture    = this.StringTexture;
                Rectangle srcRectangle     = new Rectangle(0, 0, 512, 256);
                SizeF     destinationSize2 = new SizeF(512f, 256f);
                position1 = this.Position;
                double num1 = (double)((int)position1.X + 2 + this.OffsetX);
                position1 = this.Position;
                double num2      = (double)((int)position1.Y + 2 + (int)((double)this.OffsetY * (double)destinationSize1.Height / 90.0));
                PointF position2 = new PointF((float)num1, (float)num2);
                Color  color     = Color.FromArgb(150, 0, 0, 0);
                spriteMain.Draw2D(stringTexture, srcRectangle, destinationSize2, position2, color);
            }
            MySprite  spriteMain1      = this.SpriteMain;
            Texture   stringTexture1   = this.StringTexture;
            Rectangle srcRectangle1    = new Rectangle(0, 0, 512, 256);
            SizeF     destinationSize3 = new SizeF(512f, 256f);

            position1 = this.Position;
            double num3 = (double)((int)position1.X + this.OffsetX);

            position1 = this.Position;
            double num4      = (double)((int)position1.Y + (int)((double)this.OffsetY * (double)destinationSize1.Height / 90.0));
            PointF position3 = new PointF((float)num3, (float)num4);
            Color  fontColor = this.FontColor;

            spriteMain1.Draw2D(stringTexture1, srcRectangle1, destinationSize3, position3, fontColor);
            if (this.StringTexture2 == null)
            {
                return;
            }
            MySprite  spriteMain2      = this.SpriteMain;
            Texture   stringTexture2   = this.StringTexture2;
            Rectangle srcRectangle2    = new Rectangle(0, 0, 512, 256);
            SizeF     destinationSize4 = new SizeF(512f, 256f);

            position1 = this.Position;
            double num5 = (double)((int)position1.X + this.OffsetX);

            position1 = this.Position;
            double num6       = (double)((int)position1.Y + (int)((double)this.OffsetY * (double)destinationSize1.Height / 90.0));
            PointF position4  = new PointF((float)num5, (float)num6);
            Color  fontColor2 = this.FontColor2;

            spriteMain2.Draw2D(stringTexture2, srcRectangle2, destinationSize4, position4, fontColor2);
        }
Example #5
0
        public override void Show()
        {
            MySprite spriteMain        = this.SpriteMain;
            Texture  txTure            = this.TxtureObject.TXTure;
            PointF   originalPosition1 = this.OriginalPosition;
            int      x = (int)originalPosition1.X;

            originalPosition1 = this.OriginalPosition;
            int       y                 = (int)originalPosition1.Y;
            Rectangle srcRectangle      = new Rectangle(x, y, 512, 22);
            SizeF     destinationSize   = new SizeF(512f, 22f);
            PointF    rotationCenter    = new PointF(0.0f, 0.0f);
            PointF    originalPosition2 = this.OriginalPosition;
            Color     white             = Color.White;

            spriteMain.Draw2D(txTure, srcRectangle, destinationSize, rotationCenter, 0.0f, originalPosition2, white);
        }
Example #6
0
        public override void Show()
        {
            SizeF     sizeF           = new SizeF((float)this.TxtureObject.Width * this.Scale, (float)this.TxtureObject.Height * this.Scale);
            MySprite  spriteMain      = this.SpriteMain;
            Texture   txTure          = this.TxtureObject.TXTure;
            Rectangle posRect         = this.TxtureObject.PosRect;
            SizeF     destinationSize = sizeF;
            PointF    rotationCenter  = new PointF(0.0f, 0.0f);
            double    angle           = this.Angle;
            PointF    position1       = this.Position;
            double    num1            = (double)position1.X - (double)this.OffsetX;

            position1 = this.Position;
            double num2      = (double)position1.Y - (double)this.OffsetY;
            PointF position2 = new PointF((float)num1, (float)num2);
            Color  color     = Color.FromArgb(this.TransparentValue, this.ColorValue);

            spriteMain.Draw2D(txTure, posRect, destinationSize, rotationCenter, (float)angle, position2, color);
        }
Example #7
0
        public override void ShowCenter()
        {
            if (!this.SlowMove)
            {
                return;
            }
            MySprite      spriteMain1    = this.SpriteMain;
            TextureObject textureObject1 = this.TextureObjectDictionary["SlowEffect01"];
            double        num1           = -this.Direction * 4.0;
            PointF        position1      = this.Position;
            double        x1             = (double)position1.X;

            position1 = this.Position;
            double y1        = (double)position1.Y;
            PointF position2 = new PointF((float)x1, (float)y1);

            spriteMain1.Draw2D(textureObject1, 1f, (float)num1, position2, 120);
            MySprite      spriteMain2    = this.SpriteMain;
            TextureObject textureObject2 = this.TextureObjectDictionary["SlowEffect01"];
            double        num2           = this.Direction * 4.0;
            PointF        position3      = this.Position;
            double        x2             = (double)position3.X;

            position3 = this.Position;
            double y2        = (double)position3.Y;
            PointF position4 = new PointF((float)x2, (float)y2);

            spriteMain2.Draw2D(textureObject2, 1f, (float)num2, position4, 120);
            MySprite      spriteMain3    = this.SpriteMain;
            TextureObject textureObject3 = this.TextureObjectDictionary["Center"];
            double        num3           = this.Direction * 4.0;
            PointF        position5      = this.Position;
            double        x3             = (double)position5.X;

            position5 = this.Position;
            double y3        = (double)position5.Y;
            PointF position6 = new PointF((float)x3, (float)y3);
            Color  white     = Color.White;

            spriteMain3.Draw2D(textureObject3, 1f, (float)num3, position6, white);
        }
Example #8
0
        public override void Show()
        {
            base.Show();
            if (this.TxtureObject == null)
            {
                return;
            }
            MySprite      spriteMain   = this.SpriteMain;
            TextureObject txtureObject = this.TxtureObject;
            double        scaleWidth   = (double)this.ScaleWidth;
            double        scaleLength  = (double)this.ScaleLength;
            PointF        position1    = this.Position;
            double        num1         = (double)position1.X + (double)this.TxtureObject.Width * (double)this.Scale / 2.0 + (double)this.OffX;

            position1 = this.Position;
            double num2      = (double)position1.Y + (double)this.OffY + (double)this.TxtureObject.Height * (double)this.Scale / 2.0;
            PointF position2 = new PointF((float)num1, (float)num2);
            Color  color     = Color.FromArgb(this.TransparentValue, this.ColorValue);
            int    num3      = this.Mirrored ? 1 : 0;

            spriteMain.Draw2D(txtureObject, (float)scaleWidth, (float)scaleLength, 0.0f, position2, color, num3 != 0);
        }
Example #9
0
        public override void Show()
        {
            int num1 = this.Num;

            for (int index = 0; index < this.Count; ++index)
            {
                int num2 = num1 % 10;
                num1 /= 10;
                TextureObject textureObject   = this.TextureObjectDictionary[num2.ToString()];
                MySprite      spriteMain      = this.SpriteMain;
                Texture       txTure          = textureObject.TXTure;
                Rectangle     posRect         = textureObject.PosRect;
                SizeF         destinationSize = new SizeF((float)textureObject.Width, (float)textureObject.Height);
                PointF        rotatingCenter  = textureObject.RotatingCenter;
                PointF        position1       = this.Position;
                double        num3            = (double)position1.X + (double)(16 * (this.Count - index - 1));
                position1 = this.Position;
                double y         = (double)position1.Y;
                PointF position2 = new PointF((float)num3, (float)y);
                Color  white     = Color.White;
                spriteMain.Draw2D(txTure, posRect, destinationSize, rotatingCenter, 0.0f, position2, white);
            }
        }
Example #10
0
        public override void Show()
        {
            TextureObject textureObject   = this.StageData.TextureObjectDictionary["tiaotiao2"];
            MySprite      spriteMain      = this.SpriteMain;
            Texture       txTure          = textureObject.TXTure;
            Rectangle     posRect         = textureObject.PosRect;
            SizeF         destinationSize = new SizeF((float)textureObject.Width * this.Scale, (float)textureObject.Height * this.Scale);
            PointF        rightTop        = textureObject.GetRightTop();
            PointF        position1       = this.Position;
            double        x = (double)position1.X;

            position1 = this.Position;
            double num       = (double)position1.Y - 16.0;
            PointF position2 = new PointF((float)x, (float)num);
            Color  color     = Color.FromArgb(this.TransparentValue, Color.White);

            spriteMain.Draw2D(txTure, posRect, destinationSize, rightTop, 0.0f, position2, color);
            base.Show();
            if (this.StageData.SCBstring == null)
            {
                return;
            }
            this.DrawText(this.StageData.SCBstring, new Point(240, 68), 0.6f);
        }