2005-06-08, 09:26 PM
Each plugin for GBPVR has a skin file. Each skin file defines the colors, fonts, etc.
I would like to see a root skin file that has at least the basic colors and fonts that should be used by all the plugins. Instead of each plugin's skin file defining things like ButtonText, ButtonColor and Button Font this can get pulled from the root skin file. To draw an anology to typical windows development, instead of defining specific colors in applications, most developers just use "System Colors". This way an applications we write will look mostly like the rest of the programs.
Idealy, these standard skin setting would be in the root skin file and used. If a skin developer would want to override the defaults they could. This could be done by defining an additional type of skin varable. Like maybe @@ before the name.
For example:
Root skin.xml
A plugins skin.xml
In the above example, when the plugin pulled the Background, the @@ScreenTitleText would cause the Title to render using the textStyle defined as "ScreenTitleText" from the root skin.xml.
If a skin creator want to override this, they just change @@ScreenTitleText to a local TextSytle name.
This would make skinning much easier and the overall look of plugins a little more consistant. Also, existing plugins would be backwards compatible since this switch would happen within GBPVR (well, the CommonGBPVRUtilities would need updated also).
Or have I missed something that can already be done another way?
What does everybody think? More importantly, what do you think Sub?
I would like to see a root skin file that has at least the basic colors and fonts that should be used by all the plugins. Instead of each plugin's skin file defining things like ButtonText, ButtonColor and Button Font this can get pulled from the root skin file. To draw an anology to typical windows development, instead of defining specific colors in applications, most developers just use "System Colors". This way an applications we write will look mostly like the rest of the programs.
Idealy, these standard skin setting would be in the root skin file and used. If a skin developer would want to override the defaults they could. This could be done by defining an additional type of skin varable. Like maybe @@ before the name.
For example:
Root skin.xml
Code:
<settings>
<TextStyle>
<TextStyle name="ScreenTitleText" color="LightGray" typeFace="Tahoma" size="17" style="bold"/>
</TextStyle>
</settings>
A plugins skin.xml
Code:
<settings>
<CompositeImage name="Background" size="720,480">
<DrawImage filename="..\background.jpg" loc="0,0" size="720,480"/>
<DrawText text="My Plugin" [b]textStyle="@@ScreenTitleText"[/b] loc="5,5" size="200,120" align="Left"/>
</CompositeImage>
</settings>
In the above example, when the plugin pulled the Background, the @@ScreenTitleText would cause the Title to render using the textStyle defined as "ScreenTitleText" from the root skin.xml.
If a skin creator want to override this, they just change @@ScreenTitleText to a local TextSytle name.
This would make skinning much easier and the overall look of plugins a little more consistant. Also, existing plugins would be backwards compatible since this switch would happen within GBPVR (well, the CommonGBPVRUtilities would need updated also).
Or have I missed something that can already be done another way?
What does everybody think? More importantly, what do you think Sub?