Ejemplo n.º 1
0
        protected override void Draw(GameTime gameTime)
        {
            //bloom.BeginDraw();
            GraphicsDevice.Clear(Color.Black);

            //if (sceneManager.GetSceneType() == E_Scene.GAMEPLAY)
            //{
            //    Renderer_2D.BeginBlend();
            //    sceneManager.Draw();
            //    Renderer_2D.End();
            //    base.Draw(gameTime);
            //}
            //else {
            //    base.Draw(gameTime);
            //    Renderer_2D.Begin();
            //    sceneManager.Draw();
            //    Renderer_2D.End();
            //}

            base.Draw(gameTime);

            TaskManager.Draw();

            Renderer_2D.Begin();
            sceneManager.Draw();
            Renderer_2D.End();

            //3D向けの設定変更
            //SpriteBatchが変更した設定を元に戻す。(今回はカリングの設定のみでOK)
            //GraphicsDevice.BlendState = BlendState.Opaque;
            //GraphicsDevice.DepthStencilState = DepthStencilState.Default;
            GraphicsDevice.RasterizerState = RasterizerState.CullClockwise;
            gameDevice.GetParticleGroup.Draw();
        }
Ejemplo n.º 2
0
        public override void Draw()
        {
            Renderer_2D.Begin();
            Renderer_2D.DrawString(content, Parameter.ScreenSize - new Vector2(300, 100), Color.White, 2);
            Renderer_2D.End();

            aliveTimer.Update();
        }
Ejemplo n.º 3
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.º 4
0
 private void DrawDebug()
 {
     Renderer_2D.Begin();
     Renderer_2D.DrawString("Stage1", Vector2.One * 20, Color.Red, 1.8f);
     Renderer_2D.DrawString("ObjectsCount:" + objectManager.ObjectsCount(), new Vector2(20, 100), Color.Red, 1.2f);
     Renderer_2D.DrawString("Position:" + focus, new Vector2(1440, 60), Color.Red, 1.1f);
     Renderer_2D.DrawString("Page:" + (int)(focus.X / 2000), new Vector2(1440, 120), Color.Red, 1.1f);
     Renderer_2D.End();
 }
Ejemplo n.º 5
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.º 6
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.º 7
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.º 8
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.º 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 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.º 11
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.º 12
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.º 13
0
 private void DrawWall()
 {
     Renderer_2D.Begin(Camera2D.GetTransform());
     for (int i = 0; i < mapPointsList[eObjectType.Wall].Count; i += 2)
     {
         Renderer_2D.DrawLine(
             mapPointsList[eObjectType.Wall][i].Position,
             mapPointsList[eObjectType.Wall][i + 1].Position,
             Color.LightGreen
             );
     }
     Renderer_2D.End();
 }
Ejemplo n.º 14
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.º 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
        public override void Draw()
        {
            Renderer_2D.Begin(Camera2D.GetTransform());

            if (scrollSpeed == 0)
            {
                DrawNoScoll();
            }
            else
            {
                DrawScoll();
            }

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

            for (int i = 0; i < linePoint.Count - 1; i++)
            {
                Renderer_2D.DrawLine(
                    linePoint[i],
                    linePoint[i + 1],
                    Color.Yellow
                    );
            }

            Renderer_2D.End();
        }
Ejemplo n.º 18
0
        /// <summary>
        /// 描画
        /// </summary>
        public void Draw()
        {
            Renderer_2D.Begin();

            int currentCount = resourceLoader.CurrentCount;
            int pasent       = (int)(currentCount / (float)totalResouceNum * 100f);

            //完成率を数字で表示
            if (totalResouceNum != 0)
            {
                Renderer_2D.DrawString(pasent + "%", new Vector2(1800, 1000), Color.White, 1.5f);
            }

            Renderer_2D.End();
        }
Ejemplo n.º 19
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.º 20
0
 private void DrawBezierLine()
 {
     Renderer_2D.Begin(Camera2D.GetTransform());
     for (int i = 0; i < bezierPositions.Count; i++)
     {
         for (int j = 0; j < bezierPositions[i].Count - 1; j++)
         {
             Renderer_2D.DrawLine(
                 bezierPositions[i][j],
                 bezierPositions[i][j + 1],
                 Color.Yellow
                 );
         }
     }
     Renderer_2D.End();
 }
Ejemplo n.º 21
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.º 22
0
        public void Draw()
        {
            Renderer_2D.Begin();
            Renderer_2D.DrawString("BezierIndex:" + bezierIndex, new Vector2(20, 160), Color.Red, 1.2f);
            Renderer_2D.End();

            bezierManager.Draw();
            DrawWall();

            for (int i = 0; i < mapPointsList.Count; i++)
            {
                mapPointsList[(eObjectType)i].ForEach(o => o.Draw());
            }
            mouse.Draw();

            entitysList.ForEach(e => e.Draw());

            hintsList.ForEach(l => l.ForEach(h => h.Draw()));
        }
Ejemplo n.º 23
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.º 24
0
        public override void Draw()
        {
            if (!Parameter.IsDebug)
            {
                return;
            }

            Renderer_2D.Begin(Camera2D.GetTransform());

            for (int i = 0; i < bezierPoints.Count; i++)
            {
                for (int j = 0; j < bezierPoints[i].Count - 1; j++)
                {
                    Renderer_2D.DrawLine(
                        bezierPoints[i][j],
                        bezierPoints[i][j + 1],
                        Color.Yellow
                        );
                }
            }

            Renderer_2D.End();
        }
Ejemplo n.º 25
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.º 26
0
        public override void Draw()
        {
            if (!Parameter.IsDebug)
            {
                return;
            }

            if (inputState.IsDown(Keys.W))
            {
                Camera2D.ZoomIn();
            }
            if (inputState.IsDown(Keys.S))
            {
                Camera2D.ZoomOut();
            }

            Renderer_2D.Begin();
            DrawTextMessage();
            Renderer_2D.End();

            Renderer_2D.Begin(Camera2D.GetTransform());
            DrawEntityPosition();
            Renderer_2D.End();
        }
Ejemplo n.º 27
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.º 28
0
 /// <summary>
 /// 描画
 /// </summary>
 public void Draw()
 {
     Renderer_2D.Begin();
     buttons.ForEach(b => b.Draw());
     Renderer_2D.End();
 }