示例#1
0
        public void Update(GameTime gameTime)
        {
            if (!textureLoader.IsEnd())
            {
                textureLoader.Update();
                return;
            }
            if (!bgmLoader.IsEnd())
            {
                bgmLoader.Update();
                return;
            }
            if (!seLoader.IsEnd())
            {
                seLoader.Update();
                return;
            }


            //読み込み処理が終わっていたらシーンを終了
            if (textureLoader.IsEnd() &&
                bgmLoader.IsEnd() &&
                seLoader.IsEnd())
            {
                endFlag = true;
            }
        }
示例#2
0
文件: Load.cs 项目: vzmc/TeamWork
        public void Update(GameTime gameTime)
        {
            if (!textureLoader.IsEnd())
            {
                textureLoader.Update();
            }
            else if (!bgmLoader.IsEnd())
            {
                bgmLoader.Update();
            }
            else if (!seLoader.IsEnd())
            {
                seLoader.Update();
            }

            if (timer.IsTime() && textureLoader.IsEnd() && bgmLoader.IsEnd() && seLoader.IsEnd())
            {
                timer2.Update();
            }
            if (timer2.IsTime())
            {
                endFlag = true;
            }

            timer.Update();
        }
示例#3
0
        /// <summary>
        /// 描画
        /// </summary>
        /// <param name="renderer"></param>
        public void Draw()
        {
            //描画開始
            renderer.Begin();

            renderer.DrawTexture("loading", Vector2.Zero, Drawer.Default);

            //現在読み込んでいる数を取得
            int currentCount =
                textureLoader.CurrentCount() +
                bgmLoader.CurrentCount() +
                seLoader.CurrentCount();

            //読み込むモノがあれば描画
            if (totalResouceNum != 0)
            {
                //読み込んだ割合
                float rate = (float)currentCount / totalResouceNum;


                ////数字で描画
                renderer.DrawNumber(
                    "number",
                    new Vector2(20, 100),
                    (int)(rate * 100.0f));



                //バーで描画
                var drawer = new Drawer();
                //drawer.Scale = new Vector2(rate * Screen.Width, 20);
                drawer.Rectangle = new Rectangle(0, 0, (int)(rate * Screen.Width), 20);

                renderer.DrawTexture(
                    "load",
                    new Vector2(0, 400),
                    drawer);
            }

            //終了
            //すべてのデータを読み込んだか?
            if (textureLoader.IsEnd() && bgmLoader.IsEnd() && seLoader.IsEnd())
            {
                isEndFlag = true;
            }

            //描画終了
            renderer.End();
        }
示例#4
0
        /// <summary>
        /// 描画
        /// </summary>
        /// <param name="renderer"></param>
        public void Draw(Renderer renderer)
        {
            //描画開始
            renderer.Begin();

            renderer.DrawTexture("load", new Vector2(20, 20));

            //現在読み込んでいる数を取得
            int currentCount =
                textureLoader.CurrentCount() +
                bgmLoader.CurrentCount() +
                seLoader.CurrentCount();

            //読み込むモノがあれば描画
            if (totalResouceNum != 0)
            {
                //読み込んだ割合
                float rate = (float)currentCount / totalResouceNum;
                //数字で描画
                renderer.DrawNumber(
                    "number",
                    new Vector2(20, 100),
                    (int)(rate * 100.0f));

                //バーで描画
                renderer.DrawTexture(
                    "fade",
                    new Vector2(0, 500),
                    null,
                    0.0f,
                    Vector2.Zero,
                    new Vector2(rate * Screen.WIDTH, 20));
            }

            //終了
            //すべてのデータを読み込んだか?
            if (textureLoader.IsEnd() && bgmLoader.IsEnd() && seLoader.IsEnd())
            {
                isEndFlag = true;
            }

            //描画終了
            renderer.End();
        }
示例#5
0
        /// <summary>
        /// 描画(読み込み進行状態を表す)
        /// </summary>
        /// <param name="gameTime">GameTime</param>
        public void Draw(GameTime gameTime)
        {
            renderer.DrawTexture("LodingGround", Vector2.Zero);

            renderer.DrawTexture("load", new Vector2(20, 20));

            int currentCount = textureLoader.CurrentCount() + bgmLoader.CurrentCount() + seLoader.CurrentCount();

            if (totalResouceNum != 0)
            {
                renderer.DrawNumber(
                    "number",
                    new Vector2(20, 100),
                    (int)(currentCount / (float)totalResouceNum * 100.0f));
            }

            if (textureLoader.IsEnd() && bgmLoader.IsEnd() && seLoader.IsEnd())
            {
                endFlag = true;
            }
        }
示例#6
0
        /// <summary>
        /// 描画
        /// </summary>
        /// <param name="renderer"></param>
        public void Draw()
        {
            //描画開始
            renderer.Begin();

            //現在読み込んでいる数を取得
            int currentCount =
                textureLoader.CurrentCount() +
                bgmLoader.CurrentCount() +
                seLoader.CurrentCount();

            //読み込むモノがあれば描画
            if (totalResouceNum != 0)
            {
                GameDevice.Instance().GetGraphicsDevice().Clear(Color.Black);
                //読み込んだ割合
                float rate = (float)currentCount / totalResouceNum;

                if (rate >= 0.33f)
                {
                    loadnum = 1;
                }
                if (rate >= 0.66f)
                {
                    loadnum = 2;
                }

                var loadDrawer = new Drawer();
                loadDrawer.Rectangle = new Rectangle(0, 80 * loadnum, 417, 80);

                renderer.DrawTexture("load", new Vector2(30, 256), loadDrawer);

                var playerDrawer = new Drawer();
                playerDrawer.Rotation = rotate;
                playerDrawer.Origin   = new Vector2(64 / 2, 64 / 2);
                renderer.DrawTexture("player", new Vector2(Screen.Width / 2 - 32, 330), playerDrawer);

                /*
                 * //数字で描画
                 * renderer.DrawNumber(
                 *  "number",
                 *  new Vector2(20, 100),
                 *  (int)(rate * 100.0f));
                 */

                //バーで描画
                //var drawer = new Drawer();
                //drawer.Scale = new Vector2(rate * Screen.Width, 20);

                //renderer.DrawTexture(
                //    "white",
                //    new Vector2(0, 500),
                //    drawer);
            }

            //終了
            //すべてのデータを読み込んだか?
            if (textureLoader.IsEnd() && bgmLoader.IsEnd() && seLoader.IsEnd())
            {
                isEndFlag = true;
            }

            //描画終了
            renderer.End();
        }