Ejemplo n.º 1
0
        public void Draw()
        {
            Vector2   imgSize = ResouceManager.GetTextureSize(imgName);
            Rectangle rect    = new Rectangle(0, 0, (int)imgSize.X, (int)imgSize.Y);

            Renderer_2D.DrawTexture(imgName, position, alpha, rect, Vector2.One * size, 0, imgSize / 2);
        }
Ejemplo n.º 2
0
        private void DrawFocus()
        {
            Renderer_2D.Begin(Camera2D.GetTransform());
            Vector2   imgSize = ResouceManager.GetTextureSize("Focus");
            Rectangle rect    = new Rectangle(0, 0, (int)imgSize.X, (int)imgSize.Y);

            Renderer_2D.DrawTexture("Focus", focus, Color.Yellow, 0.2f, rect, Vector2.One, 0, imgSize / 2);
            Renderer_2D.End();
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 描画
        /// </summary>
        /// <param name="renderer">2D描画管理</param>
        public void Draw()
        {
            Vector2 operSize     = ResouceManager.GetTextureSize("Page_Ending");
            Vector2 operPosition = new Vector2((Parameter.ScreenSize.X - operSize.X) / 2, 0);

            Renderer_2D.DrawTexture("Page_Ending", operPosition);

            promptButton.Draw();
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 描画
        /// </summary>
        public void Draw()
        {
            //Renderer_2D.DrawTexture("BackGround", Vector2.Zero);
            promptButton.Draw();

            Vector2 operSize     = ResouceManager.GetTextureSize("Page_Operation");
            Vector2 operPosition = new Vector2((Parameter.ScreenSize.X - operSize.X) / 2, 0);

            Renderer_2D.DrawTexture("Page_Operation", operPosition);
        }
Ejemplo n.º 5
0
        private void DrawEntityPosition()
        {
            string    name     = "P_Cross";
            Vector2   position = entity.transform.Position;
            Vector2   imgSize  = ResouceManager.GetTextureSize(name);
            float     radian   = MathHelper.ToRadians(entity.transform.Angle);
            Rectangle rect     = new Rectangle(0, 0, (int)imgSize.X, (int)imgSize.Y);

            Renderer_2D.DrawTexture(name, position, Color.Red, alpha, rect, Vector2.One * 1.5f, radian, imgSize / 2);
        }
Ejemplo n.º 6
0
        /// <summary>
        /// 描画
        /// </summary>
        public void Draw()
        {
            //Renderer_2D.DrawTexture("BackGround", Vector2.Zero);
            promptButton.Draw();

            Vector2 staSize     = ResouceManager.GetTextureSize("Page_StaffScroll");
            Vector2 staPosition = new Vector2((Parameter.ScreenSize.X - staSize.X) / 2, 0);

            Renderer_2D.DrawTexture("Page_StaffScroll", staPosition);
        }
Ejemplo n.º 7
0
        public override void Draw()
        {
            Renderer_2D.Begin(Camera2D.GetTransform());

            string    name    = energyBar.GetImgName();
            Vector2   imgSize = ResouceManager.GetTextureSize(name);
            Rectangle rect    = new Rectangle(0, 0, (int)(imgSize.X * energyBar.GetRate()), (int)imgSize.Y);

            Vector2 position = entity.transform.Position;

            while (entity.transform.Angle < 0)
            {
                entity.transform.Angle += 360;
            }
            float angle = entity.transform.Angle;

            if (angle % 180 == 0)
            {
                angle--;
            }
            float   radian     = MathHelper.ToRadians(angle);
            Vector2 direction  = new Vector2((float)Math.Cos(radian), (float)Math.Sin(radian));
            Vector2 offsetVert = Method.RightAngleMove(direction, 270);

            angle += 90;
            int area = (int)(angle / 90);

            radian    = MathHelper.ToRadians(angle);
            direction = new Vector2((float)Math.Cos(radian), (float)Math.Sin(radian));

            radian = MathHelper.ToRadians(entity.transform.Angle);

            Vector2 offsetHori = Vector2.Zero;

            if (area % 4 == 0 || area % 4 == 2)
            {
                offsetHori = Method.RightAngleMove(direction, 40);
            }
            else
            {
                offsetHori = Method.RightAngleMove(direction, -40);
            }
            Renderer_2D.DrawTexture(
                name,
                position + offsetVert + offsetHori,
                Color.LightGreen,
                alpha,
                rect,
                Vector2.One,
                radian,
                imgSize / 2
                );

            Renderer_2D.End();
        }
Ejemplo n.º 8
0
        protected virtual void DrawObject()
        {
            Renderer_2D.Begin(Camera2D.GetTransform());

            Vector2   imgSize = ResouceManager.GetTextureSize(name);
            Rectangle rect    = new Rectangle(0, 0, (int)imgSize.X, (int)imgSize.Y);

            Renderer_2D.DrawTexture(name, position, Color.White, 1, rect, Vector2.One, 0, imgSize / 2);

            Renderer_2D.End();
        }
Ejemplo n.º 9
0
 private void DrawHelpPage()
 {
     if (isPause)
     {
         Renderer_2D.Begin();
         Vector2   imgSize = ResouceManager.GetTextureSize("HelpPage");
         Rectangle rect    = new Rectangle(0, 0, (int)imgSize.X, (int)imgSize.Y);
         Renderer_2D.DrawTexture("HelpPage", Parameter.ScreenSize / 2, Color.White, 1, rect, Vector2.One, 0, imgSize / 2);
         Renderer_2D.End();
     }
 }
Ejemplo n.º 10
0
        public override void Draw()
        {
            Renderer_2D.Begin(Camera2D.GetTransform());

            Vector2   imgSize = ResouceManager.GetTextureSize(name);
            Rectangle rect    = new Rectangle(0, 0, (int)imgSize.X, (int)imgSize.Y);

            Renderer_2D.DrawTexture(name, position, alpha, rect, Vector2.One, 0, imgSize / 2);

            Renderer_2D.End();
        }
Ejemplo n.º 11
0
        public void Draw()
        {
            Renderer_2D.Begin(Camera2D.GetTransform());

            Vector2   imgSize = ResouceManager.GetTextureSize("Mouse");
            Rectangle rect    = new Rectangle(0, 0, (int)imgSize.X, (int)imgSize.Y);

            Renderer_2D.DrawTexture("Mouse", GetPosition(), Color.LightBlue, Vector2.One);

            Renderer_2D.End();
        }
Ejemplo n.º 12
0
        public void Draw()
        {
            Renderer_2D.Begin(Camera2D.GetTransform());

            for (int i = 0; i < imgCount; i++)
            {
                string imageName = name + i;
                Renderer_2D.DrawTexture(imageName, layerPositions[i]);
            }

            Renderer_2D.End();
        }
Ejemplo n.º 13
0
        protected override void DrawObject()
        {
            Renderer_2D.Begin(Camera2D.GetTransform());

            Color color = isSelected ? Color.Red : Color.White;

            Vector2   imgSize = ResouceManager.GetTextureSize(name);
            Rectangle rect    = new Rectangle(0, 0, (int)imgSize.X, (int)imgSize.Y);

            Renderer_2D.DrawTexture(name, position, color, 1, rect, Vector2.One, 0, imgSize / 2);

            Renderer_2D.End();
        }
Ejemplo n.º 14
0
        public override void Draw()
        {
            Renderer_2D.Begin(Camera2D.GetTransform());

            Vector2   position = entity.transform.Position + offset;
            Vector2   imgSize  = ResouceManager.GetTextureSize(name);
            Rectangle rect     = new Rectangle(0, 0, (int)imgSize.X, (int)imgSize.Y);
            Vector2   drawSize = new Vector2(size.X / imgSize.X, size.Y / imgSize.Y) * 2;

            Renderer_2D.DrawTexture(name, position, color, alpha, rect, drawSize, 0, imgSize / 2);

            Renderer_2D.End();
        }
Ejemplo n.º 15
0
 public void Draw()
 {
     Renderer_2D.Begin();
     Renderer_2D.DrawTexture("ToolBar" + pageNo, startPosition);
     Renderer_2D.DrawTexture("ToolBarMask", startPosition + new Vector2(80 * ((int)nowType % 10), 0));
     for (int i = 0; i < 9; i++)
     {
         Renderer_2D.DrawString((i + 1).ToString(), startPosition + new Vector2(30, -35) + new Vector2(80 * i, 0), Color.Red, 0.8f);
     }
     Renderer_2D.DrawString(0.ToString(), startPosition + new Vector2(30, -35) + new Vector2(80 * 9, 0), Color.Red, 0.8f);
     Renderer_2D.DrawString("-".ToString(), startPosition + new Vector2(30, -35) + new Vector2(80 * 10, 0), Color.Red, 0.8f);
     Renderer_2D.DrawString("+".ToString(), startPosition + new Vector2(30, -35) + new Vector2(80 * 11, 0), Color.Red, 0.8f);
     Renderer_2D.End();
 }
Ejemplo n.º 16
0
        protected virtual void DrawCollition()
        {
            Renderer_2D.Begin(Camera2D.GetTransform());

            Color color = isMouseIn ? Color.Red : Color.Yellow;

            Vector2   imgSize  = ResouceManager.GetTextureSize("CollisionArea");
            Rectangle rect     = new Rectangle(0, 0, (int)imgSize.X, (int)imgSize.Y);
            Vector2   drawSize = new Vector2(radius / imgSize.X, radius / imgSize.Y) * 2;

            Renderer_2D.DrawTexture("CollisionArea", position, color, 0.5f, rect, drawSize, 0, imgSize / 2);

            Renderer_2D.End();
        }
Ejemplo n.º 17
0
        public override void Draw()
        {
            actionTimer.Update();
            CreatSecondCircle();
            SkillAction();

            Renderer_2D.Begin(Camera2D.GetTransform());

            Vector2   position = entity.transform.Position - new Vector2(0, 130);
            Rectangle rect     = new Rectangle(0, 0, (int)imgSize.X, (int)imgSize.Y);

            Renderer_2D.DrawTexture(name, position, alpha * 0.8f, rect, Vector2.One * nowSize, 0, imgSize / 2);

            Renderer_2D.End();
        }
Ejemplo n.º 18
0
        public override void Draw()
        {
            locusPositions.Add(entity.transform.Position);
            if (locusPositions.Count > 100)
            {
                locusPositions.RemoveAt(0);
            }

            Renderer_2D.Begin(Camera2D.GetTransform());

            locusPositions.ForEach(locus =>
                                   Renderer_2D.DrawTexture(name, locus, 1, rect, Vector2.One, 0, imgSize / 2, depth)
                                   );

            Renderer_2D.End();
        }
Ejemplo n.º 19
0
        private void DrawNoScoll()
        {
            for (int i = 0; i < imgCount; i++)
            {
                if ((layerPositions[i] + Camera2D.GetOffsetPosition()).X < -Parameter.BackGroundSize)
                {
                    continue;
                }
                if ((layerPositions[i] + Camera2D.GetOffsetPosition()).X > Parameter.ScreenSize.X)
                {
                    continue;
                }

                string imageName = name + i;
                Renderer_2D.DrawTexture(imageName, layerPositions[i]);
            }
        }
Ejemplo n.º 20
0
        private void DrawScoll()
        {
            scrollPosition.X += scrollSpeed * Camera2D.GetCameraMove().X;
            for (int i = 0; i < imgCount; i++)
            {
                string imageName = name + i;
                Renderer_2D.DrawTexture(imageName, layerPositions[i] + scrollPosition);

                if (layerPositions[i].X + scrollPosition.X + Camera2D.GetOffsetPosition().X <= -Parameter.BackGroundSize)
                {
                    layerPositions[i] += new Vector2(Parameter.BackGroundSize * imgCount, 0);
                }
                else if (layerPositions[i].X + scrollPosition.X + Camera2D.GetOffsetPosition().X >= Parameter.BackGroundSize)
                {
                    layerPositions[i] -= new Vector2(Parameter.BackGroundSize * imgCount, 0);
                }
            }
        }
Ejemplo n.º 21
0
        protected override void DrawObject()
        {
            base.DrawObject();

            Renderer_2D.Begin(Camera2D.GetTransform());

            //Renderer_2D.DrawLine(leftTop.Position, rightBottom.Position, Color.LightBlue, false);

            Vector2 centre = (leftTop.Position + rightBottom.Position) / 2;
            Vector2 square = rightBottom.Position - leftTop.Position;
            Vector2 size   = ResouceManager.GetTextureSize("UnitLine");

            square.X /= size.X;
            square.Y /= size.Y;
            Rectangle rect = new Rectangle(0, 0, (int)size.X, (int)size.Y);

            Renderer_2D.DrawTexture("UnitLine", centre, 0.2f, rect, square, 0, size / 2);

            Renderer_2D.End();
        }
Ejemplo n.º 22
0
        private void DrawBezierCurve()
        {
            if (bezierCurves.Count == 0)
            {
                return;
            }

            Renderer_2D.Begin(Camera2D.GetTransform());
            Vector2   imgSize = ResouceManager.GetTextureSize("Point");
            Rectangle rect    = new Rectangle(0, 0, (int)imgSize.X, (int)imgSize.Y);

            for (int k = 0; k < bezierCurves.Count; k++)
            {
                for (int i = 0; i < bezierCurves[k].Count; i++)
                {
                    for (int j = 0; j < bezierCurves[k][i].Count; j++)
                    {
                        Renderer_2D.DrawTexture("Point", bezierCurves[k][i][j], Color.LightGreen, 1, rect, Vector2.One * 0.3f, 0, imgSize / 2);
                    }
                }
            }
            Renderer_2D.End();
        }
Ejemplo n.º 23
0
        public override void Draw()
        {
            if (motion == null)
            {
                return;
            }

            float   radian    = MathHelper.ToRadians(entity.transform.Angle);
            Vector2 position  = entity.transform.Position;
            Vector2 direction = new Vector2((float)Math.Cos(radian), (float)Math.Sin(radian));

            if (isShaderOn)
            {
                shadeTimer.Update();
                if (shadeTimer.IsTime)
                {
                    effect.Parameters["theMask"].SetValue(ResouceManager.GetTexture("NoneMask"));
                }

                graphicsDevice.RasterizerState = RasterizerState.CullClockwise;
                effect.Parameters["Rate"].SetValue(shadeTimer.Rate());

                Vector2 drawPosition = position + Camera2D.GetOffsetPosition() + Method.RightAngleMove(direction, animSpriteSize.Y / 2);
                Vector3 drawP3       = new Vector3(drawPosition, 0);

                VertexUpdate(drawP3);
                graphicsDevice.SetVertexBuffer(vertexBuffer);
                foreach (EffectPass pass in effect.CurrentTechnique.Passes)
                {
                    pass.Apply();
                    graphicsDevice.DrawUserPrimitives <VertexPositionTexture>(
                        PrimitiveType.TriangleStrip,
                        vertexPositions, 0, 2
                        );
                }

                if (shadeTimer.IsTime)
                {
                    isShaderOn = false;
                }
            }
            else
            {
                motion.Update();
                Renderer_2D.Begin(Camera2D.GetTransform());

                while (entity.transform.Angle < 0)
                {
                    entity.transform.Angle += 360;
                }
                int angle = (int)(entity.transform.Angle / 90);

                Renderer_2D.DrawTexture(
                    nowAnim.AnimName,
                    position + Method.RightAngleMove(direction, animSpriteSize.Y / 2),
                    alpha,
                    motion.DrawingRange(),
                    Vector2.One * size,
                    radian,
                    animSpriteSize / 2,
                    angle % 4 == 0 || angle % 4 == 3
                    );

                Renderer_2D.End();
            }
        }
Ejemplo n.º 24
0
 /// <summary>
 /// 描画
 /// </summary>
 /// <param name="renderer">2D描画管理</param>
 public void Draw()
 {
     Renderer_2D.DrawTexture("Page_Clear", Vector2.Zero);
 }
Ejemplo n.º 25
0
        /// <summary>
        /// 描画
        /// </summary>
        public void Draw()
        {
            Renderer_2D.DrawTexture("Page_Title", Vector2.Zero);

            buttons.ForEach(b => b.Draw());
        }