This patch adds the capability of all controls (as far as I can see) that draw text to natively (optionally) display a shadowed version of that text.
Skinners have historically created the effect of shadow text by duplicating (for example) labels in the skin (shadow first followed by the overlapping foreground text). With this patch skinner can now use the following attributes to specify a shadow on the text:
shadowAngle - the integral angle, in degrees, of the shadow text. Zero degrees is along the x-axis, increasing positive values from zero will rotate the shadow clockwise.
shadowDistance - the number of pixels the shadow is offset from the normal (foreground) text.
shadowColor - the color of the shadow.
Here is a list of controls that support these attributes:
The following Windows Plugins are also affected by this patch but only to the extent that they interface well with changes to the base GUI controls.
The default shadow behavior is "no shadow". So all existing skins will work fine (this change is backward compatible).
The main implementation is handled in GUIFont.cs. This is where the shadow position is computed and drawn. I looked into adding a shadowBlur parameter but this requires some management of a view matrix and it appears that MP uses several optional methods to draw to the graphics context. An enterprising person that understands matrix transformations can likely add a blur feature pretty easily.
Except for the plugins, this patch replaces core.dll (it updates the GUI library).
I have personally tested this with Label and Button and it works great.
Let me know what you think.
EDIT: Added GUIFont.cs as an attachment per request (bummer that it's marked as a binary - that should be fixed too ;-)
Skinners have historically created the effect of shadow text by duplicating (for example) labels in the skin (shadow first followed by the overlapping foreground text). With this patch skinner can now use the following attributes to specify a shadow on the text:
shadowAngle - the integral angle, in degrees, of the shadow text. Zero degrees is along the x-axis, increasing positive values from zero will rotate the shadow clockwise.
shadowDistance - the number of pixels the shadow is offset from the normal (foreground) text.
shadowColor - the color of the shadow.
Here is a list of controls that support these attributes:
- Button
- CheckButton
- CheckList
- FadeLabel
- Label
- List
- Menu
- PlayListItemList
- PlayListButton
- SelectButton
- ThumbnailPanel
- ToggleButton
- UpDownButton
- UpDownList
The following Windows Plugins are also affected by this patch but only to the extent that they interface well with changes to the base GUI controls.
- NumberPlace
- RadioGuide
- TvGuide
The default shadow behavior is "no shadow". So all existing skins will work fine (this change is backward compatible).
The main implementation is handled in GUIFont.cs. This is where the shadow position is computed and drawn. I looked into adding a shadowBlur parameter but this requires some management of a view matrix and it appears that MP uses several optional methods to draw to the graphics context. An enterprising person that understands matrix transformations can likely add a blur feature pretty easily.
Except for the plugins, this patch replaces core.dll (it updates the GUI library).
I have personally tested this with Label and Button and it works great.
Let me know what you think.
EDIT: Added GUIFont.cs as an attachment per request (bummer that it's marked as a binary - that should be fixed too ;-)