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

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

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. 
.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