Rise
The Vieneo Province
Toggle main menu visibility
Loading...
Searching...
No Matches
Text.cpp
Go to the documentation of this file.
1
#include "
Text.h
"
2
3
Text::Text
(
Logger
* prmLogger,
Bus
* prmBus,
DeviceObject
* prmpDevice,
Rendering::RenderFont
* prmFont,
int
prmX,
int
prmY,
int
prmWidth,
int
prmHeight)
4
{
5
prmLogger->
AddToCallStack
(
"Text::ctor"
);
6
7
logger
= prmLogger;
8
pDevice
= prmpDevice;
9
pFont
= prmFont;
10
bus
= prmBus;
11
x
= prmX;
12
y
= prmY;
13
width
= prmWidth;
14
height
= prmHeight;
15
16
rect
.top =
y
;
17
if
(
height
)
18
rect
.bottom =
rect
.top +
height
;
19
else
20
rect
.bottom = 0;
21
rect
.left =
x
;
22
if
(
width
)
23
rect
.right =
rect
.left +
width
;
24
else
25
rect
.right = 0;
26
27
const
float
z
= 1.0f;
// on top of everything
28
transform
=
RiseMath::Matrix
(
29
1.0f, 0.0f, 0.0f, 0.0f,
30
0.0f, 1.0f, 0.0f, 0.0f,
31
0.0f, 0.0f, 1.0f, 0.0f,
32
0.0f, 0.0f,
z
, 1.0f);
33
}
34
35
void
Text::Draw
(WCHAR* str)
36
{
37
logger
->
AddToCallStack
(
"Text::Draw"
);
38
HRESULT
hr;
39
RiseMath::Color
newcolor;
40
//if (bus->IsDim(elementName))
41
// newcolor = color * 0.5f;
42
//else
43
newcolor =
color
;
44
45
V
(
pDevice
->
pSprite
->
SetTransform
(&
transform
));
46
47
if
(FAILED(hr =
pFont
->
DrawTextW
(
pDevice
->
pSprite
, str, -1, &
rect
,
flags
, newcolor)))
48
{
49
logger
->
Log
(
"Text::DrawText DrawText failed!"
,
Logger::Fatal
, hr);
50
}
51
}
V
#define V(expression)
Definition
ClientRuntime11.h:41
HRESULT
HRESULT(WINAPI *CUniBuffer::_ScriptApplyDigitSubstitution)(const SCRIPT_DIGITSUBSTITUTE *
Text.h
Bus
Definition
Bus.h:20
DeviceObject
Definition
DeviceObject.h:8
DeviceObject::pSprite
Rendering::RenderSprite * pSprite
Definition
DeviceObject.h:21
Logger
Definition
Logger.h:11
Logger::Log
void Log(const char *msg, Level level=Info, int errorCode=0)
Definition
Logger.cpp:283
Logger::AddToCallStack
void AddToCallStack(const char *msg)
Definition
Logger.cpp:355
Logger::Fatal
@ Fatal
Definition
Logger.h:29
Rendering::RenderFont
Definition
ClientRenderer11.h:222
Rendering::RenderFont::DrawTextW
INT DrawTextW(RenderSprite *sprite, const wchar_t *text, INT count, RECT *rectangle, DWORD flags, PackedColor color)
Definition
ClientResources11.cpp:236
Rendering::RenderSprite::SetTransform
HRESULT SetTransform(const RiseMath::Matrix *value)
Definition
ClientRenderer11.h:206
Text::flags
int flags
Definition
Text.h:66
Text::x
int x
Definition
Text.h:62
Text::z
float z
Definition
Text.h:63
Text::rect
RECT rect
Definition
Text.h:52
Text::width
int width
Definition
Text.h:65
Text::color
RiseMath::Color color
Definition
Text.h:64
Text::logger
Logger * logger
Definition
Text.h:53
Text::pDevice
DeviceObject * pDevice
Definition
Text.h:55
Text::bus
Bus * bus
Definition
Text.h:54
Text::y
int y
Definition
Text.h:62
Text::transform
RiseMath::Matrix transform
Definition
Text.h:58
Text::Draw
void Draw(WCHAR *str)
Definition
Text.cpp:35
Text::Text
Text(Logger *prmLogger, Bus *prmBus, DeviceObject *prmpDevice, Rendering::RenderFont *prmFont, int prmX, int prmY, int prmWidth, int prmHeight)
Definition
Text.cpp:3
Text::height
int height
Definition
Text.h:65
Text::pFont
Rendering::RenderFont * pFont
Definition
Text.h:57
RiseMath::Color
Definition
ClientMath.h:67
RiseMath::Matrix
Definition
ClientMath.h:80
Displays
Text.cpp
Generated on
for Rise by
1.18.0