示例#1
0
        void SetupV4(ref DX.VERTEX3D[] v4, int uv_x, int uv_y, int uv_w, int uv_h, int image_wh_size)
        {
            v4[0].norm = DX.VGet(0.0f, 1.0f, 0.0f);
            v4[1].norm = DX.VGet(0.0f, 1.0f, 0.0f);
            v4[2].norm = DX.VGet(0.0f, 1.0f, 0.0f);
            v4[3].norm = DX.VGet(0.0f, 1.0f, 0.0f);
            v4[4].norm = DX.VGet(0.0f, 1.0f, 0.0f);
            v4[5].norm = DX.VGet(0.0f, 1.0f, 0.0f);
            v4[0].dif  = dif_color;
            v4[1].dif  = dif_color;
            v4[2].dif  = dif_color;
            v4[3].dif  = dif_color;
            v4[4].dif  = dif_color;
            v4[5].dif  = dif_color;
            DX.COLOR_U8 spc = DX.GetColorU8(70, 70, 70, 255);
            v4[0].spc = spc;
            v4[1].spc = spc;
            v4[2].spc = spc;
            v4[3].spc = spc;
            v4[4].spc = spc;
            v4[5].spc = spc;

            float u0 = (float)uv_x / (float)image_wh_size;
            float v0 = (float)uv_y / (float)image_wh_size;
            float u1 = (float)(uv_x + uv_w) / (float)image_wh_size;
            float v1 = (float)(uv_y + uv_h) / (float)image_wh_size;

            v4[0].u = u0; v4[0].v = v0;
            v4[1].u = u1; v4[1].v = v0;
            v4[2].u = u1; v4[2].v = v1;
            v4[3].u = u0; v4[3].v = v0;
            v4[4].u = u0; v4[4].v = v1;
            v4[5].u = u1; v4[5].v = v1;
        }
示例#2
0
        public void Draw()
        {
            // 描画
            for (int x = 0; x < map_w; x++)
            {
                for (int y = 0; y < map_h; y++)
                {
                    var p      = x + y * map_w;
                    var sq     = map_squares[p];
                    var height = sq.height;

                    // 頂上のスクウェアを描画
                    sq.Draw();

                    // カーソル描画
                    if (x == map_cursor_x && y == map_cursor_y)
                    {
                        dif_color = DX.GetColorU8(255, 0, 0, 128);
                        DrawSpriteXZ(x * 10.0f, height * HIGHT_ONE_VALUE + 0.01f, y * 10.0f, 10, 10, DX.DX_NONE_GRAPH, 0, 0, 32, 32, 32);
                        dif_color = DX.GetColorU8(255, 255, 255, 255);
                    }
                    if (move_area.squares[p].is_ok)
                    {
                        // 移動範囲
                        dif_color = DX.GetColorU8(0, move_area.squares[p].step_count * 20, 255, 128);
                        DrawSpriteXZ(x * 10.0f, height * HIGHT_ONE_VALUE + 0.01f, y * 10.0f, 10, 10, DX.DX_NONE_GRAPH, 0, 0, 32, 32, 32);
                        dif_color = DX.GetColorU8(255, 255, 255, 255);
                    }
                    if (route_as_move_area != null && route_as_move_area.squares[p].step_count >= 0)
                    {
                        // 移動経路
                        dif_color = DX.GetColorU8(255, 255, 255, 255);
                        DX.SetDrawBlendMode(DX.DX_BLENDMODE_ADD, 128);
                        DrawSpriteXZ(x * 10.0f, height * HIGHT_ONE_VALUE + 0.01f, y * 10.0f, 10, 10, DX.DX_NONE_GRAPH, 0, 0, 32, 32, 32);
                        dif_color = DX.GetColorU8(255, 255, 255, 255);
                        DX.SetDrawBlendMode(DX.DX_BLENDMODE_NOBLEND, 0);
                    }
                    if (action_target_area.squares[p].is_pass) // is_okはユニットがいるマス、is_passは純粋な射程範囲
                    {
                        // 行動の対象選択範囲
                        dif_color = DX.GetColorU8(255, 0, 0, 128);
                        DrawSpriteXZ(x * 10.0f, height * HIGHT_ONE_VALUE + 0.01f, y * 10.0f, 10, 10, DX.DX_NONE_GRAPH, 0, 0, 32, 32, 32);
                        dif_color = DX.GetColorU8(255, 255, 255, 255);
                    }
                }
            }

            // 壁面カーソルの描画
            if (map_cursor_wall != null)
            {
                var copy_panel = map_cursor_wall.panel.CopyFrom();
                copy_panel.Draw();
            }

            // 手番ユニットのカーソル表示
            if (cursor_turn_owner_unit != null && is_draw_cursor_turn_owner)
            {
                model_cursor_turn_owner.Draw();
            }
        }
示例#3
0
        public S3DPanel(S3DPoint pos, SDPoint size, Direction direction = Direction.Top)
        {
            this.pos       = pos;
            this.size      = size;
            this.direction = direction;

            dif_color = DX.GetColorU8(255, 0, 0, 0);
            spc_color = DX.GetColorU8(0, 0, 0, 255);
        }
示例#4
0
 public void SetSpecularColor(int a, int r, int g, int b)
 {
     spc_color = DX.GetColorU8(r, g, b, a);
 }
示例#5
0
 public void SetColor(int a, int r, int g, int b)
 {
     dif_color = DX.GetColorU8(r, g, b, a);
 }