Example #1
0
        static public void Draw(D3dBB2d bb, d3d_device device, float z, Vector2 offset, float scale, int color)
        {
            Vector2 pos  = offsetscale(bb.Min, offset, scale);
            Vector2 pos2 = offsetscale(bb.Max, offset, scale);

            pos  += bb.OffsetLT;
            pos2 += bb.OffsetRB;
            Vector2 size = pos2 - pos;

            device.DrawLineRect(new Vector3(pos.X, pos.Y, z), size, color);
        }
Example #2
0
            /*-------------------------------------------------------------------------
             * 그리기
             * ---------------------------------------------------------------------------*/
            public void Draw()
            {
                if (m_window_mode == mode.small)
                {
                    // 最소化
                    int color = m_title_color;
                    color &= 0x00ffffff;
                    color |= (64 << 24);
                    m_device.DrawFillRect(new Vector3(m_pos.X, m_pos.Y, m_z), new Vector2(SMALL_HEADER_WIDTH, 10), color);
                    m_device.DrawLineRect(new Vector3(m_pos.X, m_pos.Y, m_z), new Vector2(SMALL_HEADER_WIDTH, 10), m_frame_color);

                    // 통상化ボタン
                    m_device.DrawLineRect(new Vector3(m_pos.X + SMALL_HEADER_WIDTH - 10, m_pos.Y, m_z), new Vector2(10, 10), Color.Black.ToArgb());
                    m_device.DrawLineRect(new Vector3(m_pos.X + SMALL_HEADER_WIDTH - 7, m_pos.Y + 3, m_z), new Vector2(4, 4), Color.FromArgb(50, 50, 50).ToArgb());
                }
                else
                {
                    // 통상時
                    m_device.DrawFillRect(new Vector3(m_pos.X, m_pos.Y, m_z), m_size, m_back_color);
                    if (is_draw_header)
                    {
                        m_device.DrawFillRect(new Vector3(m_pos.X, m_pos.Y, m_z), new Vector2(m_size.X, 10), m_title_color);
                        m_device.DrawLineRect(new Vector3(m_pos.X, m_pos.Y, m_z), new Vector2(m_size.X, 10), m_frame_color);
                    }
                    m_device.DrawLineRect(new Vector3(m_pos.X, m_pos.Y, m_z), m_size, m_frame_color);

                    // 最소化ボタン
                    m_device.DrawFillRect(new Vector3(m_pos.X + m_size.X - 10, m_pos.Y, m_z), new Vector2(10, 10), Color.LightGray.ToArgb());
                    m_device.DrawLineRect(new Vector3(m_pos.X + m_size.X - 10, m_pos.Y, m_z), new Vector2(10, 10), Color.Black.ToArgb());
                    m_device.DrawLine(new Vector3(m_pos.X + m_size.X - 7, m_pos.Y + 7, m_z), new Vector2(m_pos.X + m_size.X - 2, m_pos.Y + 7), Color.FromArgb(50, 50, 50).ToArgb());

                    if (m_client_size.Y >= 0)
                    {
                        // 그리기범위をクライアント領域に限定する
                        //						Viewport	view	= SetViewport(	(int)client_pos.X,
                        //															(int)client_pos.Y,
                        //															(int)client_size.X +1,
                        //															(int)client_size.Y +1);
                        // 그리기
                        OnDrawClient();
                        // 元に戻す
                        //						m_device.device.Viewport	= view;
                    }
                }
            }