-
Notifications
You must be signed in to change notification settings - Fork 50
/
aibox.cpp
36 lines (27 loc) · 1.18 KB
/
aibox.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include "Drawing.h"
void Drawing::DrawBorderBox( int x, int y, int w, int h, int thickness, D3DCOLOR Colour, IDirect3DDevice9 *pDevice)
{
//Top horiz line
DrawFilledRect( x, y, w, thickness, Colour, pDevice );
//Left vertical line
DrawFilledRect( x, y, thickness, h, Colour, pDevice );
//right vertical line
DrawFilledRect( (x + w), y, thickness, h, Colour, pDevice );
//bottom horiz line
DrawFilledRect( x, y + h, w+thickness, thickness, Colour, pDevice );
}
//We receive the 2-D Coordinates the color and the device we want to use to draw those colors with
void Drawing::DrawFilledRect(int x, int y, int w, int h, D3DCOLOR color, IDirect3DDevice9* dev)
{
//We create our rectangle to draw on screen
D3DRECT BarRect = { x, y, x + w, y + h };
//We clear that portion of the screen and display our rectangle
dev->Clear(1, &BarRect, D3DCLEAR_TARGET | D3DCLEAR_TARGET, color, 0, 0);
}
void Drawing::Draw_Text(LPCSTR TextToDraw, int x, int y, D3DCOLOR Colour, LPD3DXFONT m_font)
{
// Create a rectangle to indicate where on the screen it should be drawn
RECT rct = {x- 120, y, x+ 120, y + 15};
// Draw some text
m_font->DrawText(NULL, TextToDraw, -1, &rct, DT_NOCLIP, Colour );
}