예제 #1
0
void cPlayer::PlayerHpRender(cD2DRenderer& renderer)
{

	WCHAR str[128];
	wsprintf(str, L"0,1,2,3 = %d, %d, %d, %d", CrushOn, State[0], State[1],NPCState[0]);
	UINT32 cTextLength_c = (UINT32)wcslen(str);

	D2D1_RECT_F layoutRectc = D2D1::RectF(830, 150, 1130, 250);

	renderer.GetRenderTarget()->DrawTextW(
		str,
		cTextLength_c,
		renderer.GetTextFormat(),
		layoutRectc,
		renderer.GetBrush());


	if (PlayerHpBar != nullptr);
	{
		::D2D1_RECT_F dxArea = ::D2D1::RectF(
			239,
			507,
			239 + (3.73*PlayerHp),
			523);
		::D2D1_RECT_F srcArea = ::D2D1::RectF(0, 0, 135, 12);
		renderer.GetRenderTarget()->DrawBitmap(PlayerHpBar, dxArea, 1.0f,
			D2D1_BITMAP_INTERPOLATION_MODE_LINEAR,
			srcArea);
	}
}
예제 #2
0
void cChatting::Render(cD2DRenderer& renderer)
{
	for (int i = 0; i < m_vecChatList.size(); ++i)
	{

		if (m_vecChatList.size() > 0)
		{
			UINT32 cTextLength_c = (UINT32)wcslen(m_vecChatList[i].c_str());

			D2D1_RECT_F layoutRect = D2D1::RectF(
				100,
				50 + i * 20, 
				700,
				300 + i * 20
				);

			renderer.GetRenderTarget()->DrawTextW(
				m_vecChatList[i].c_str(),
				cTextLength_c,
				renderer.GetTextFormat(),
				layoutRect,
				renderer.GetBrush());
		}

	}

}
예제 #3
0
void cMonster::Render(cD2DRenderer& renderer)
{
	if (SightX && SightY)
	{
		if (MonsterHp > 0)
		{
			if (Monster != nullptr);
			{
				::D2D1_RECT_F dxArea = ::D2D1::RectF(
					Screen.x + MonsterPos.x - 16,
					Screen.y + MonsterPos.y - 52,
					Screen.x + MonsterPos.x + 16,
					Screen.y + MonsterPos.y);
				::D2D1_RECT_F srcArea = ::D2D1::RectF(310, 103, 375, 198);
				renderer.GetRenderTarget()->DrawBitmap(Monster, dxArea, 1.0f,
					D2D1_BITMAP_INTERPOLATION_MODE_LINEAR,
					srcArea);
			}
		}
		//else Monster = nullptr;
	}


	WCHAR str[128];
	wsprintf(str, L"MonsterCrushOn = %d, %d", MonsterCrushOn, Delta_E);
	UINT32 cTextLength_c = (UINT32)wcslen(str);

	D2D1_RECT_F layoutRectc = D2D1::RectF(830, 200, 1130, 250);

	renderer.GetRenderTarget()->DrawTextW(
		str,
		cTextLength_c,
		renderer.GetTextFormat(),
		layoutRectc,
		renderer.GetBrush());

}