DX UI Static Controls

Started by
3 comments, last by nickvbs 18 years, 4 months ago
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;
Advertisement
You could make your own class, or edit/override the existing one
JUST-CODE-IT.NETManaged DirectX & C# TutorialsForumsArticlesLinksSamples
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 easiest way would be to use a font like courier new, where all the characters are the same size (if I remember correctly).
Insufficent Information: we need more infromationhttp://staff.samods.org/aiursrage2k/
Thanks, your right about the courier new. I'll give you a good rating

This topic is closed to new replies.

Advertisement