Holds a set of materials and colors for Scenes UI controls, as well as the font to be used.
View code on GitHub
Inheritance Hierarchy
DeltaEngine.Content ContentData
DeltaEngine.Scenes.Controls Theme
DeltaEngine.Scenes.Tests.Controls ThemeTests ThemeLoader
Namespace: DeltaEngine.Scenes.Controls
Assembly: DeltaEngine.Scenes (in DeltaEngine.Scenes.dll) Version: 1.1.1.0 (1.1.1)
Syntax
The Theme type exposes the following members.
Constructors
Name | Description | |
---|---|---|
Theme | Initializes a new instance of the Theme class |
Methods
Name | Description | |
---|---|---|
CreateDefault | (Inherited from ContentData.) | |
Dispose | (Inherited from ContentData.) | |
DisposeData | (Overrides ContentData DisposeData .) | |
InternalCreateDefault | (Inherited from ContentData.) | |
LoadData | (Overrides ContentData LoadData(Stream).) | |
LoadFromFile | ||
ToString | (Inherited from ContentData.) |
Fields
Name | Description | |
---|---|---|
ContentChanged | (Inherited from ContentData.) |
Properties
Remarks
Examples
[Test, CloseAfterFirstFrame] public void SaveAndLoadDefaultTheme() { var theme = new Theme(); var stream = BinaryDataExtensions.SaveToMemoryStream(theme); var loadedTheme = (Theme)stream.CreateFromMemoryStream(); Assert.IsTrue(AreMaterialsEqual(theme.ButtonMouseover, loadedTheme.ButtonMouseover)); Assert.IsTrue(AreMaterialsEqual(theme.ScrollbarPointer, loadedTheme.ScrollbarPointer)); Assert.IsTrue(AreMaterialsEqual(theme.TextBoxFocused, loadedTheme.TextBoxFocused)); }
[Test, CloseAfterFirstFrame] public void SaveAndLoadModifiedTheme() { var theme = new Theme(); theme.Slider = new Material(ShaderFlags.Position2DColoredTextured, "DeltaEngineLogo") { DefaultColor = Color.Red }; var stream = BinaryDataExtensions.SaveToMemoryStream(theme); var loadedTheme = (Theme)stream.CreateFromMemoryStream(); Assert.IsTrue(AreMaterialsEqual(theme.Slider, loadedTheme.Slider)); }
[Test, CloseAfterFirstFrame] public void LoadTheme() { Theme theme = CreateSampleTheme(); var loadedData = new ThemeLoader().LoadValidData(dataStream); AssertLoadedThemeData(theme, loadedData); }
See Also