DX UI Static Controls
Is there a way to change the background color or put a texture/skin for static controls? I can change the bk color of the whole dialog but thats not what I want.
Heres some code to look at...
g_UI.AddStatic( IDC_MSG, L"Hello, Static ", 315, 410, 100, 200 );
g_UI.SetFont(1, L"Times New Roman", 15, NULL);
pElementMsg = g_UI.GetStatic(IDC_MSG)->GetElement(0);
pElementMsg->SetFont(1,D3DCOLOR_ARGB(255,255,255,255),DT_CENTER | DT_WORDBREAK);
pElementMsg->Refresh();
pElementMsg = NULL;
right now I'm rendering a sprite behind the static control that acts as a frame for making floating type captions. The sprite width is fixed and the height is adjusted based on the length of the string stored in the static control.
The problem is that not every character takes up the same amount of space. For example, when the string is in all caps, the frames(sprite) height is usually to short.
HeightScale = int(wcslen(m_Tiles.strDescr) / 15) + 1;
The problem is that not every character takes up the same amount of space. For example, when the string is in all caps, the frames(sprite) height is usually to short.
HeightScale = int(wcslen(m_Tiles.strDescr) / 15) + 1;
The easiest way would be to use a font like courier new, where all the characters are the same size (if I remember correctly).
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement