📄 cgoods.cpp
字号:
//--------------------------------------------------------------------------------------------------------
// 游戏物品模块
//CGoods.cpp
//游戏引擎中的物品部分
//作者:吴振华(kylinx)(中国科大01级11系)
//E-mail:game-diy@163.com
//创建于:2003/6/17 by Kylinx
//最后修改于2003/7/20 by Kylinx
//--------------------------------------------------------------------------------------------------------
#include"CGoods.h"
#include"CDataBase.h"
#include"CRender.h"
#include"CFont.h"
#include"CText.h"
#include"dxlib\\ddutil.h"
BOOL CRenderRoleGoods::SetRender(CDisplay*pDisplay,CFont*pFont,STGood*pGood)
{
m_pDisplay=pDisplay;
m_pFont=pFont;
m_pGood=pGood;
return true;
}
void LOA_RENDER_API CRenderRoleGoods::Release()
{
}
void LOA_RENDER_API CRenderRoleGoods::Render()
{
CText text;
HDC hdc;
m_pDisplay->GetBackBuffer()->GetDC(&hdc);
::SetBkMode(hdc,TRANSPARENT);
::SetTextColor(hdc,RGB(0,255,0));
::SelectObject(hdc,m_pFont->GetFont());
if(m_pGood)
{
text.ShowMultiLineText(380,110,hdc,20,"物品名字:%s,价值:%d",m_pGood->szName,m_pGood->dwPrice);
text.ShowMultiLineText(380,260,hdc,20,m_pGood->szIntroduce);
}
else
{
text.ShowMultiLineText(380,110,hdc,20,"没有任何物品");
}
m_pDisplay->GetBackBuffer()->ReleaseDC(hdc);
}
BOOL LOA_RENDER_API CRenderRoleGoods::IsRenderComplete()
{
return true;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -