Zen.GuiControls 0.1.2

There is a newer version of this package available.
See the version list below for details.
dotnet add package Zen.GuiControls --version 0.1.2
                    
NuGet\Install-Package Zen.GuiControls -Version 0.1.2
                    
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.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Zen.GuiControls" Version="0.1.2" />
                    
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.2
                    
#r "nuget: Zen.GuiControls, 0.1.2"
                    
#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.2
                    
#: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.2
                    
Install as a Cake Addin
#tool nuget:?package=Zen.GuiControls&version=0.1.2
                    
Install as a Cake Tool

Zen.GuiControls

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

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
_controls = ControlCreator.CreateFromResource("Game1.PanelControls.txt", new KeyValuePair<string, string>("backgroundColor", "CornflowerBlue"));

// in LoadContent
_foreach (var control in _controls)
{
    control.LoadContent(content, true);
}

// in Update
foreach (var control in _controls)
{
    control.Update(_input, (float)gameTime.ElapsedGameTime.TotalMilliseconds);
}

// in Draw
spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend);
foreach (var control in _controls)
{
    control.Draw(spriteBatch);
}
spriteBatch.End();

<pre> The file: Game1.PanelControls.txt
lblTest : Label
{
FontName: arial
Size: 100;50
ContentAlignment: BottomRight
Text: Test
GetTextFunc: 'Game1.EventHandlers.GetTextFunc'
TextColor: Aqua
TextShadowColor: White
BackgroundColor: %backgroundColor%
BorderColor: Red
PositionAlignment: BottomRight
Position: 100;50
Scale: 1.0
LayerDepth: 0.0
Enabled: true
Packages: ['Zen.GuiControls.PackagesClasses.ControlClick, Zen.GuiControls - Game1.EventHandlers.ApplySettings']
}

lblApply : Label
{
FontName: arial
Size: 100;25
Text: Apply
TextColor: CornflowerBlue
ContentAlignment: MiddleCenter
}

btnApply : Button
{
TextureNormal: TextureNormal
TextureActive: TextureActive
TextureHover: TextureHover
TextureDisabled: TextureDisabled
Size: 100;25
Color: Green
PositionAlignment: TopLeft
Position: 50;200
LayerDepth: 1.0
Enabled: true
Contains: [lblApply]
Packages: ['Zen.GuiControls.PackagesClasses.ControlClick, Zen.GuiControls - Game1.EventHandlers.ApplySettings']
}

frmPanel : Frame
{
Size: 200;500
Contains: [lblTest;btnApply]
} </pre>

Developer

Written by Greg Moller (greg.moller@gmail.com)

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 538 12/28/2020
0.1.12 443 12/27/2020
0.1.11 466 12/27/2020
0.1.10 473 12/15/2020
0.1.9 522 12/5/2020
0.1.8 607 11/21/2020
0.1.7 535 11/16/2020
0.1.6 490 11/14/2020
0.1.5 494 11/11/2020
0.1.4 526 11/9/2020
0.1.3 502 11/5/2020
0.1.2 623 10/31/2020
0.1.1 456 10/31/2020
0.1.0 477 10/29/2020