Пример #1
0
 public Model_Triangle(
     Device DeviceMain,
     TextureObject TxtureObject,
     string Name,
     Vector2 LeftTop,
     Vector2 RightTop,
     Vector2 LeftBottom,
     int Width,
     int Height)
 {
     this.TransparentValue = (int)byte.MaxValue;
     this.ColorValue       = Color.White;
     this.DeviceMain       = DeviceMain;
     this.TxtureObject     = TxtureObject;
     this.Name             = Name;
     this.LeftTop          = LeftTop;
     this.RightTop         = RightTop;
     this.LeftBottom       = LeftBottom;
     this.Width            = Width;
     this.Height           = Height;
     this.vertexDecl       = new VertexDeclaration(DeviceMain, TexturedVertex.VertexElements);
     this.vertexBuffer     = new VertexBuffer(DeviceMain, 3 * TexturedVertex.SizeBytes, Usage.WriteOnly, VertexFormat.None, Pool.Managed);
     this.material         = new Material();
     this.SetupVertex();
 }
Пример #2
0
        public override void Show()
        {
            if (this.TxtureObject == null)
            {
                return;
            }
            PointF position = new PointF((float)(((double)this.OriginalPosition.X + (double)this.LastPoints[this.LastPoints.Length - 1].X) / 2.0), (float)(((double)this.OriginalPosition.Y + (double)this.LastPoints[this.LastPoints.Length - 1].Y) / 2.0));

            position = new PointF(position.X + (float)this.BoundRect.Left, position.Y + (float)this.BoundRect.Top);
            this.SpriteMain.Draw2D(this.TxtureObject, this.ScaleWidth, this.ScaleLength, (float)(this.Direction - Math.PI / 2.0 + this.Angle), position, Color.FromArgb(this.TransparentValue, this.ColorValue), this.Mirrored);
            if (!this.LaserHead)
            {
                return;
            }
            TextureObject textureObject = this.TextureObjectDictionary["光点"];

            if ((byte)0 < this.ColorType && this.ColorType <= (byte)2)
            {
                textureObject = this.TextureObjectDictionary["FY_Particle6_0"];
            }
            else if ((byte)2 < this.ColorType && this.ColorType <= (byte)4)
            {
                textureObject = this.TextureObjectDictionary["FY_Particle4_0"];
            }
            else if ((byte)4 < this.ColorType && this.ColorType <= (byte)8)
            {
                textureObject = this.TextureObjectDictionary["FY_Particle5_0"];
            }
            this.SpriteMain.Draw2D(textureObject, 0.4f, 0.4f, (float)(this.Direction - Math.PI / 2.0 + this.Angle + (double)this.Time / 10.0), this.Position, Color.FromArgb(this.HeadTransparent, this.ColorValue), this.Mirrored);
        }
Пример #3
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);
        }
Пример #4
0
 public MyLife_Line(
     StageDataPackage StageData,
     TextureObject TxtureObject,
     PointF OriginalPosition)
     : base(StageData, TxtureObject, OriginalPosition)
 {
     this.size = 16f;
 }
Пример #5
0
 public Life_Line(
     StageDataPackage StageData,
     TextureObject TxtureObject,
     PointF OriginalPosition)
     : base(StageData, (string)null, OriginalPosition)
 {
     this.TxtureObject = TxtureObject;
 }
Пример #6
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);
        }
Пример #7
0
 public void Draw2D(
     TextureObject txtureObject,
     float scale,
     float rotationAngle,
     PointF position,
     int transpanrent)
 {
     this.Draw2D(txtureObject, scale, rotationAngle, position, Color.FromArgb(transpanrent, Color.White));
 }
Пример #8
0
 public void Draw2D(
     TextureObject txtureObject,
     float scale,
     float rotationAngle,
     PointF position,
     Color color)
 {
     this.Draw2D(txtureObject, scale, rotationAngle, position, txtureObject.RotatingCenter, color);
 }
Пример #9
0
 public void Draw2D(
     TextureObject txtureObject,
     float scale,
     float rotationAngle,
     PointF position,
     PointF rotationCenter,
     Color color)
 {
     this.Draw2D(txtureObject, scale, rotationAngle, position, rotationCenter, color, false);
 }
Пример #10
0
 public void Draw2D(
     TextureObject txtureObject,
     float scaleX,
     float scaleY,
     float rotationAngle,
     PointF position,
     Color color,
     bool mirrored)
 {
     this.Draw2D(txtureObject, scaleX, scaleY, rotationAngle, position, txtureObject.RotatingCenter, color, mirrored);
 }
Пример #11
0
 public Model(Device DeviceMain, TextureObject TxtureObject, string Name)
 {
     TransparentValue  = byte.MaxValue;
     ColorValue        = Color.White;
     this.DeviceMain   = DeviceMain;
     this.TxtureObject = TxtureObject;
     this.Name         = Name;
     vertexDecl        = new VertexDeclaration(DeviceMain, TexturedVertex.VertexElements);
     vertexBuffer      = new VertexBuffer(DeviceMain, 4 * TexturedVertex.SizeBytes, Usage.WriteOnly, VertexFormat.None, Pool.Managed);
     material          = new Material();
     SetupVertex();
 }
Пример #12
0
 public Model_Circle(Device DeviceMain, TextureObject TxtureObject, string Name)
 {
     this.TransparentValue = (int)byte.MaxValue;
     this.ColorValue       = Color.White;
     this.DeviceMain       = DeviceMain;
     this.TxtureObject     = TxtureObject;
     this.Name             = Name;
     this.vertexDecl       = new VertexDeclaration(DeviceMain, TexturedVertex.VertexElements);
     this.vertexBuffer     = new VertexBuffer(DeviceMain, 2 * (this.Length + 1) * TexturedVertex.SizeBytes, Usage.WriteOnly, VertexFormat.None, Pool.Managed);
     this.material         = new Material();
     this.SetupVertex();
 }
Пример #13
0
        public void Draw2D(TextureObject txtureObject, float scaleX, float scaleY, float rotationAngle, PointF position, PointF rotationCenter, Color color, bool mirrored)
        {
            Vector3 vector3_1 = new Vector3(rotationCenter.X, rotationCenter.Y, 0.0f);
            Vector3 vector3_2 = new Vector3(position.X, position.Y, 0.0f);
            Color4  color1    = new Color4(color);
            Vector2 vector2_1 = new Vector2(rotationCenter.X, rotationCenter.Y);
            Vector2 vector2_2 = new Vector2(position.X, position.Y);
            Vector2 vector2_3 = vector2_1 + vector2_2;
            Vector2 scaling   = mirrored ? new Vector2(-scaleX, scaleY) : new Vector2(scaleX, scaleY);

            sprite.Transform = Matrix.Transformation2D(vector2_2, 0.0f, scaling, vector2_2, rotationAngle, new Vector2(0.0f, 0.0f));
            sprite.Draw(txtureObject.TXTure, new Rectangle?(txtureObject.PosRect), new Vector3?(vector3_1), new Vector3?(vector3_2), color1);
            sprite.Transform = Matrix.Identity;
        }
Пример #14
0
        public override void Show()
        {
            SizeF  destinationSize = new SizeF(this.size, this.size);
            PointF position        = new PointF();
            PointF originalPosition;

            for (int index = 0; index < 8; ++index)
            {
                TextureObject textureObject = this.TextureObjectDictionary["Life0d"];
                ref PointF    local         = ref position;
                originalPosition = this.OriginalPosition;
                double num = (double)originalPosition.X + (double)index * (double)this.size;
                originalPosition = this.OriginalPosition;
                double y = (double)originalPosition.Y;
                local = new PointF((float)num, (float)y);
                this.SpriteMain.Draw2D(textureObject.TXTure, textureObject.PosRect, destinationSize, new PointF(0.0f, 0.0f), 0.0f, position, Color.FromArgb(this.TransparentValue, Color.White));
            }
Пример #15
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);
        }
Пример #16
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);
        }
Пример #17
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);
            }
        }
Пример #18
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);
        }
Пример #19
0
 public void Draw2D(TextureObject txtureObject, float scale, float rotationAngle, PointF position, PointF rotationCenter, Color color, bool mirrored) => Draw2D(txtureObject, scale, scale, rotationAngle, position, rotationCenter, color, mirrored);