A simple menu system where all buttons are the same size and auto-arrange on screen.
When any control is added to the scene it will also autoassign the renderlayer. This applies
to all controls, not just menu buttons.
View code on GitHub
Inheritance Hierarchy
DeltaEngine.Content ContentData
DeltaEngine.Scenes Scene
DeltaEngine.Scenes AutoArrangingMenu
DeltaEngine.Scenes.Tests AutoArrangingMenuTests MenuXml
Namespace: DeltaEngine.Scenes
Assembly: DeltaEngine.Scenes (in DeltaEngine.Scenes.dll) Version: 1.1.1.0 (1.1.1)
Syntax
The AutoArrangingMenu type exposes the following members.
Constructors
Name | Description | |
---|---|---|
AutoArrangingMenu(String) | Initializes a new instance of the AutoArrangingMenu class | |
AutoArrangingMenu(Size, Int32) | Initializes a new instance of the AutoArrangingMenu class |
Methods
Name | Description | |
---|---|---|
Add(Entity2D) | (Overrides Scene Add(Entity2D).) | |
Add(IEnumerable Entity2D ) | (Inherited from Scene.) | |
AddControlToScene | (Inherited from Scene.) | |
AddMenuOption(Action, String) | ||
AddMenuOption(Theme, Action, String) | ||
Clear | (Overrides Scene Clear .) | |
ClearMenuOptions | ||
CreateDefault | (Inherited from ContentData.) | |
Dispose | (Inherited from ContentData.) | |
DisposeData | (Inherited from Scene.) | |
Hide | (Inherited from Scene.) | |
InternalCreateDefault | (Inherited from ContentData.) | |
LoadData | (Inherited from Scene.) | |
LoadFromFile | (Inherited from Scene.) | |
Remove | (Inherited from Scene.) | |
SetQuadraticBackground(String) | (Inherited from Scene.) | |
SetQuadraticBackground(Material) | (Inherited from Scene.) | |
SetViewportBackground(String) | (Inherited from Scene.) | |
SetViewportBackground(Material) | (Inherited from Scene.) | |
Show | (Inherited from Scene.) | |
ToBackground | (Inherited from Scene.) | |
ToForeground | (Inherited from Scene.) | |
ToString | (Inherited from ContentData.) |
Fields
Name | Description | |
---|---|---|
background | (Inherited from Scene.) | |
ContentChanged | (Inherited from ContentData.) |
Properties
Name | Description | |
---|---|---|
AllowCreationIfContentNotFound | (Inherited from ContentData.) | |
ButtonSize | ||
Center | ||
Controls | (Inherited from Scene.) | |
DrawArea | (Inherited from Scene.) | |
IsDisposed | (Inherited from ContentData.) | |
MetaData | (Inherited from ContentData.) | |
Name | (Inherited from ContentData.) | |
RenderLayer |
Remarks
Examples
[Test] public void CreateNewMenuWithContentName() { AutoArrangingMenu menuByName = ContentLoader.Load<MenuXml>("TestMenuXml"); Assert.AreEqual(menuByName.Name, "TestMenuXml"); }
[Test, ApproveFirstFrameScreenshot] public void ShowMenuWithTwoButtons() { menu.AddMenuOption(() => { text.Text = "Clicked Top Button"; });
[Test] public void ShowMenuWithThreeButtons() { menu.AddMenuOption(() => { text.Text = "Clicked Top Button"; });
See Also