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.
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.
// Install Zen.GuiControls as a Cake Addin
#addin nuget:?package=Zen.GuiControls&version=0.1.5

// Install Zen.GuiControls as a Cake Tool
#tool nuget:?package=Zen.GuiControls&version=0.1.5                

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. 
.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 464 12/28/2020
0.1.12 376 12/27/2020
0.1.11 401 12/27/2020
0.1.10 409 12/15/2020
0.1.9 459 12/5/2020
0.1.8 541 11/21/2020
0.1.7 470 11/16/2020
0.1.6 423 11/14/2020
0.1.5 430 11/11/2020
0.1.4 460 11/9/2020
0.1.3 429 11/5/2020
0.1.2 558 10/31/2020
0.1.1 391 10/31/2020
0.1.0 411 10/29/2020