-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCBtn_Option.cpp
66 lines (56 loc) · 1.53 KB
/
CBtn_Option.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#include "pch.h"
#include "CBtn_Option.h"
#include "CResMgr.h"
#include "CFontMgr.h"
#include "CCamera.h"
#include "CTexture.h"
#include "CUI_Dialog.h"
CBtn_Option::CBtn_Option()
: m_bHighLighted(false)
, m_bAnswer(false)
{
m_pUnSelectImg = CResMgr::GetInst()->LoadTexture(L"button_1", L"texture\\ui\\dialog\\dialog_ui\\button_1.bmp");
m_pSelectImg = CResMgr::GetInst()->LoadTexture(L"button_2", L"texture\\ui\\dialog\\dialog_ui\\button_2.bmp");
}
CBtn_Option::~CBtn_Option()
{
}
void CBtn_Option::Update()
{
}
void CBtn_Option::Render(HDC _dc)
{
if (m_iMyPage != m_pOwnerDialog->GetCurPage())
return;
CUI::Render(_dc);
Vec vRenderPos = CCamera::GetInst()->GetRenderPos(GetPos());
// À̹ÌÁö ·»´õ
if (m_bHighLighted)
{
TransparentBlt(_dc
, int(vRenderPos.x) // x
, int(vRenderPos.y) // y
, int(m_pSelectImg->Width()) // width
, int(m_pSelectImg->Height()) // height
, m_pSelectImg->GetDC() // Src's HDC
, 0, 0
, int(m_pSelectImg->Width()) // width in atlas
, int(m_pSelectImg->Height()) // height int atlas
, RGB(112, 12, 41));
}
else
{
TransparentBlt(_dc
, int(vRenderPos.x) // x
, int(vRenderPos.y) // y
, int(m_pUnSelectImg->Width()) // width
, int(m_pUnSelectImg->Height()) // height
, m_pUnSelectImg->GetDC() // Src's HDC
, 0, 0
, int(m_pUnSelectImg->Width()) // width in atlas
, int(m_pUnSelectImg->Height()) // height int atlas
, RGB(112, 12, 41));
}
// ÅؽºÆ® ·»´õ
CFontMgr::GetInst()->WriteScriptText(_dc, GetPos().x + 1000/2, GetPos().y - 10, 1000, 100, m_wstring);
}