Browse Subversion Repository
Contents of /trunk/CStaticCtrl.cpp
Parent Directory
| Revision Log
Revision 1 -
( show annotations)
( download)
( as text)
Sun Aug 15 01:53:13 2010 UTC
(13 years, 9 months ago)
by okadu
File MIME type: text/x-c++src
File size: 1080 byte(s)
| 1 |
#include "stdafx.h" |
| 2 |
#include "CStaticCtrl.h" |
| 3 |
#include "CSkinPlugin.h" |
| 4 |
|
| 5 |
/* |
| 6 |
* 初期化 |
| 7 |
*/ |
| 8 |
void CStaticCtrl::Init( |
| 9 |
int x, int y, // 座標 |
| 10 |
int w, int h, // サイズ |
| 11 |
char *t, // テキスト |
| 12 |
CInterface *p, // 親 |
| 13 |
int horz, // 水平位置 |
| 14 |
int vert // 垂直位置 |
| 15 |
){ |
| 16 |
CInterface::Init(x, y, w, h, t, p); |
| 17 |
m_HorzPos = horz; |
| 18 |
m_VertPos = vert; |
| 19 |
} |
| 20 |
|
| 21 |
/* |
| 22 |
* レンダリング |
| 23 |
*/ |
| 24 |
void CStaticCtrl::Render(){ |
| 25 |
CInterface::RenderBrother(); |
| 26 |
if(!m_Visible) return; |
| 27 |
int px, py, ty; |
| 28 |
GetAbsPos(&px, &py); |
| 29 |
switch(m_VertPos){ |
| 30 |
case 0: ty = py; break; |
| 31 |
case 1: ty = py+FontY(m_Height); break; |
| 32 |
case 2: ty = py+m_Height-FONT_HEIGHT; break; |
| 33 |
} |
| 34 |
switch(m_HorzPos){ |
| 35 |
case 0: |
| 36 |
g_StrTex->RenderLeft(px, ty, |
| 37 |
g_Skin->m_InterfaceData.m_StaticFontColor, 0, m_Text.c_str()); |
| 38 |
break; |
| 39 |
case 1: |
| 40 |
g_StrTex->RenderCenter(px+m_Width/2, ty, |
| 41 |
g_Skin->m_InterfaceData.m_StaticFontColor, 0, m_Text.c_str()); |
| 42 |
break; |
| 43 |
case 2: |
| 44 |
g_StrTex->RenderRight(px+m_Width, ty, |
| 45 |
g_Skin->m_InterfaceData.m_StaticFontColor, 0, m_Text.c_str()); |
| 46 |
break; |
| 47 |
} |
| 48 |
CInterface::RenderChild(); |
| 49 |
} |
| |