Example #1
0
        /*-------------------------------------------------------------------------
         * 선그리기
         * 100단위の선となる
         * ---------------------------------------------------------------------------*/
        static public void DrawLines100(gvt_lib lib)
        {
            lib.loop_image.EnumDrawCallBack(new LoopXImage.DrawHandler(draw_lines100_proc), 0);

            // 세로방향は1회の그리기でよい
            LoopXImage image  = lib.loop_image;
            Vector2    size   = image.Device.client_size;
            Vector2    offset = image.GetDrawOffset();

            int index = 0;

            for (float y = 0; y < def.GAME_HEIGHT; y += 100, index++)
            {
                // 지도좌표に변환
                Vector2 pos0 = transform.game_pos2_map_pos(new Vector2(0, y), image);
                Vector2 pos  = image.GlobalPos2LocalPos(pos0, offset);

                if (index >= 10)
                {
                    index = 0;
                }

                if (pos.Y < 0)
                {
                    continue;
                }
                if (pos.Y >= size.Y)
                {
                    continue;
                }

                int color = (index == 0)? Color.FromArgb(128, 0, 0, 0).ToArgb(): Color.FromArgb(128, 128, 128, 128).ToArgb();
                image.Device.DrawLine(new Vector3(0, pos.Y, 0.79f), new Vector2(size.X, pos.Y), color);
            }
        }
Example #2
0
        /*-------------------------------------------------------------------------
         * 線描画
         * 1000刻みでの線となる
         * ---------------------------------------------------------------------------*/
        static public void DrawLines(gvt_lib lib)
        {
            lib.loop_image.EnumDrawCallBack(new LoopXImage.DrawHandler(draw_lines_proc), 0);

            // 縦方向は1回の描画でよい
            LoopXImage image  = lib.loop_image;
            Vector2    size   = image.Device.client_size;
            Vector2    offset = image.GetDrawOffset();

            int index = 0;

            for (float y = 0; y < def.GAME_HEIGHT; y += 1000, index++)
            {
                // 地図座標に変換
                Vector2 pos0 = transform.game_pos2_map_pos(new Vector2(0, y), image);
                Vector2 pos  = image.GlobalPos2LocalPos(pos0, offset);

                if (pos.Y < 0)
                {
                    continue;
                }
                if (pos.Y >= size.Y)
                {
                    continue;
                }

                image.Device.DrawLine(new Vector3(0, pos.Y, 0.79f), new Vector2(size.X, pos.Y), Color.FromArgb(128, 0, 0, 0).ToArgb());
            }
        }