Zen.GuiControls 0.1.5

There is a newer version of this package available.
See the version list below for details.
dotnet add package Zen.GuiControls --version 0.1.5
                    
NuGet\Install-Package Zen.GuiControls -Version 0.1.5
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Zen.GuiControls" Version="0.1.5" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Zen.GuiControls" Version="0.1.5" />
                    
Directory.Packages.props
<PackageReference Include="Zen.GuiControls" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Zen.GuiControls --version 0.1.5
                    
#r "nuget: Zen.GuiControls, 0.1.5"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Zen.GuiControls@0.1.5
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Zen.GuiControls&version=0.1.5
                    
Install as a Cake Addin
#tool nuget:?package=Zen.GuiControls&version=0.1.5
                    
Install as a Cake Tool

Zen.GuiControls

A project for user controls for use with MonoGame. Current controls: Button, Label, Image and Frame.

Nuget package download: https://www.nuget.org/packages/Zen.GuiControls/0.1.5

Examples

To use: (programmatically)

// in constructor or LoadContent

// button
_control1 = new Button("btnApply", "TextureNormal", "TextureActive", "TextureHover", "TextureDisabled")
{
    Size = new PointI(100, 25),
    Color = Color.Green
};
_control1.SetPosition(new PointI(50, 50));
_control1.AddPackage(new ControlClick(ApplySettings)); // will call method ApplySettings(object o, EventArgs args) when clicked with mouse

// label
_control2 = new Label("lblHealth", "arial")
{
    Size = new PointI(100, 25),
    ContentAlignment = Alignment.TopRight,
    Text = "Health:",
    TextColor = Color.Green,
    BorderColor = Color.Red
};
_control2.SetPosition(new PointI(10, 10));

// frame
_control3 = new Frame("frmMain")
_control3.AddControl(_control1, _control2);
_control3.SetPosition(new PointI(100, 100));

// in LoadContent
_control3.LoadContent(content, true);

// in Update
_control3.Update(_input, (float)gameTime.ElapsedGameTime.TotalMilliseconds);

// in Draw
spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend);
_control3.Draw(spriteBatch);
spriteBatch.End();

(descriptively)

// in constructor or LoadContent
var spec = @"

<pre> frmTest : Frame { TextureName: GUI_Textures_1.frame_texture Position: %position1% Size: 100;100 TopPadding: 5 BottomPadding: 5 LeftPadding: 5 RightPadding: 5

Contains: [lblTest] }

lblTest : Label { FontName: Arial Size: 100;15 ContentAlignment: TopLeft Text: Hello TextColor: Yellow

ParentContainerAlignment: ParentTopLeftAlignsWithChildTopLeft Offset: 20;20 }"; </pre> var pairs = new List<KeyValuePair<string, string>> { new KeyValuePair<string, string>("position1", "1680;0") }; _controls = ControlCreator.CreateFromSpecification(spec, pairs);

// in LoadContent
_controls.LoadContent(content, true);

// in Update
_controls.Update(_input, (float)gameTime.ElapsedGameTime.TotalMilliseconds);

// in Draw
spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend);
_controls.Draw(spriteBatch);
spriteBatch.End();

Developer

Written by Greg Moller (greg.moller@gmail.com)
If you have any questions drop me a line at the above email.

License

Licensed under the MIT License. See the LICENCE file for more information.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp3.1 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.13 577 12/28/2020
0.1.12 475 12/27/2020
0.1.11 497 12/27/2020
0.1.10 505 12/15/2020
0.1.9 554 12/5/2020
0.1.8 639 11/21/2020
0.1.7 565 11/16/2020
0.1.6 522 11/14/2020
0.1.5 526 11/11/2020
0.1.4 557 11/9/2020
0.1.3 534 11/5/2020
0.1.2 655 10/31/2020
0.1.1 489 10/31/2020
0.1.0 510 10/29/2020