您的位置:首页 > 其它

DXUT 改变控件颜色和文本

2012-03-21 15:38 183 查看
改变按钮颜色

CDXUTButton* pButtom = NULL;

g_SampleUI.AddButton( ROOMCOMMMEND-pos->second.ID, L"", 100,100, 100, 100, VK_F2, 0, &pButtom);

DXUTBlendColor g_BlendColor;//控件颜色

g_BlendColor.Init(D3DCOLOR_ARGB( 255, 30, 50, 250 ));

pButtom->GetElement( 0 )->TextureColor =g_BlendColor; //设置颜色

改变字体和内容

g_SampleUI.SetFont( 0, L"Arial", 15, FW_BOLD );//字体0

g_SampleUI.SetFont( 1, L"Arial", 25, FW_BOLD );//字体1

CDXUTStatic* pStatic = NULL;

g_SampleUI.AddStatic( DXUTSETTINGSDLG_STATIC, L"none", 100, 100, 100, 30, false, &pStatic );

pStatic->GetElement( 0 )->iFont = 1; //字体

pStatic->GetElement( 0 )->dwTextFormat = DT_BOTTOM | DT_RIGHT;//排列类型

wchar_t *buf = "change";//文本内容

pStatic->SetText(buf);//改变文本
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐