mirror of
https://github.com/Ellpeck/MLEM.git
synced 2024-11-22 12:58:33 +01:00
some fixes and doc changes to make MLEM.FNA more in line with MLEM
This commit is contained in:
parent
334918103f
commit
61055148ef
35 changed files with 35 additions and 25 deletions
|
@ -28,7 +28,7 @@
|
||||||
<Content Include="..\Demos\Content\*\**" />
|
<Content Include="..\Demos\Content\*\**" />
|
||||||
<EmbeddedResource Include="Icon.ico" />
|
<EmbeddedResource Include="Icon.ico" />
|
||||||
<EmbeddedResource Include="Icon.bmp" />
|
<EmbeddedResource Include="Icon.bmp" />
|
||||||
<Content Include="FNA/**">
|
<Content Include="FnaNative/**">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
<Link>%(Filename)%(Extension)</Link>
|
<Link>%(Filename)%(Extension)</Link>
|
||||||
</Content>
|
</Content>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
# MLEM.Ui
|
# MLEM.Ui
|
||||||
|
|
||||||
**MLEM.Ui** is a Ui framework for MonoGame that features elements with automatic positioning and sizing. It contains various ready-made element types like buttons, paragraphs, text fields and more, along with the ability to easily create custom controls. It supports **mouse**, **keyboard**, **gamepad** and **touch** input with little to no additional setup work required.
|
**MLEM.Ui** is a Ui framework for MonoGame and FNA that features elements with automatic positioning and sizing. It contains various ready-made element types like buttons, paragraphs, text fields and more, along with the ability to easily create custom controls. It supports **mouse**, **keyboard**, **gamepad** and **touch** input with little to no additional setup work required.
|
||||||
|
|
||||||
To see some of what MLEM.Ui can do, you can check out [the demo](https://github.com/Ellpeck/MLEM/blob/main/Demos/UiDemo.cs) as well.
|
To see some of what MLEM.Ui can do, you can check out [the demo](https://github.com/Ellpeck/MLEM/blob/main/Demos/UiDemo.cs) as well.
|
||||||
|
|
||||||
|
@ -35,15 +35,19 @@ On desktop devices, MonoGame provides the `Window.TextInput` event that gets cal
|
||||||
|
|
||||||
To make MLEM compatible with all devices without publishing a separate version for each MonoGame platform, you have to set up the `MlemPlatform` class based on the system you're using MLEM.Ui with. This has to be done *before* initializing your `UiSystem`.
|
To make MLEM compatible with all devices without publishing a separate version for each MonoGame platform, you have to set up the `MlemPlatform` class based on the system you're using MLEM.Ui with. This has to be done *before* initializing your `UiSystem`.
|
||||||
|
|
||||||
DesktopGL:
|
DesktopGL and WindowsDX using MonoGame:
|
||||||
```cs
|
```cs
|
||||||
MlemPlatform.Current = new MlemPlatform.DesktopGl<TextInputEventArgs>((w, c) => w.TextInput += c);
|
MlemPlatform.Current = new MlemPlatform.DesktopGl<TextInputEventArgs>((w, c) => w.TextInput += c);
|
||||||
```
|
```
|
||||||
|
Desktop using FNA:
|
||||||
|
```cs
|
||||||
|
MlemPlatform.Current = new MlemPlatform.DesktopFna(a => TextInputEXT.TextInput += a);
|
||||||
|
```
|
||||||
Mobile devices and consoles:
|
Mobile devices and consoles:
|
||||||
```cs
|
```cs
|
||||||
MlemPlatform.Current = new MlemPlatform.Mobile(KeyboardInput.Show, l => this.StartActivity(new Intent(Intent.ActionView, Uri.Parse(l))));
|
MlemPlatform.Current = new MlemPlatform.Mobile(KeyboardInput.Show, l => this.StartActivity(new Intent(Intent.ActionView, Uri.Parse(l))));
|
||||||
```
|
```
|
||||||
If you're not using text input, you can just set the platform to a stub one like so:
|
If you're not using text input, you can leave the platform uninitialized or just set it to a stub one like so:
|
||||||
```cs
|
```cs
|
||||||
MlemPlatform.Current = new MlemPlatform.None();
|
MlemPlatform.Current = new MlemPlatform.None();
|
||||||
```
|
```
|
||||||
|
|
|
@ -11,12 +11,12 @@
|
||||||
- See [the changelog](https://mlem.ellpeck.de/CHANGELOG.html) for information on updates
|
- See [the changelog](https://mlem.ellpeck.de/CHANGELOG.html) for information on updates
|
||||||
|
|
||||||
# Packages
|
# Packages
|
||||||
- **MLEM** is the base package, which provides extension methods and additional features for MonoGame
|
- **MLEM** is the base package, which provides extension methods and additional features for MonoGame and FNA.
|
||||||
- **MLEM.Ui** features a mouse, keyboard, gamepad and touch ready Ui system that features automatic anchoring, sizing and several ready-to-use element types
|
- **MLEM.Ui** features a mouse, keyboard, gamepad and touch ready Ui system that features automatic anchoring, sizing and several ready-to-use element types.
|
||||||
- **MLEM.Extended** ties in with MonoGame.Extended and other MonoGame libraries
|
- **MLEM.Extended** ties in with MonoGame.Extended and other MonoGame and FNA libraries.
|
||||||
- **MLEM.Data** provides simple loading and processing of textures and other data, including the ability to load non-XNB content files easily
|
- **MLEM.Data** provides simple loading and processing of textures and other data, including the ability to load non-XNB content files easily.
|
||||||
- **MLEM.Startup** combines MLEM with some other useful libraries into a quick Game startup class
|
- **MLEM.Startup** combines MLEM with some other useful libraries into a quick Game startup class.
|
||||||
- **MLEM.Templates** contains cross-platform project templates
|
- **MLEM.Templates** contains cross-platform project templates.
|
||||||
|
|
||||||
# Made with MLEM
|
# Made with MLEM
|
||||||
- [A Breath of Spring Air](https://ellpeck.itch.io/a-breath-of-spring-air), a short platformer ([Source](https://git.ellpeck.de/Ellpeck/GreatSpringGameJam))
|
- [A Breath of Spring Air](https://ellpeck.itch.io/a-breath-of-spring-air), a short platformer ([Source](https://git.ellpeck.de/Ellpeck/GreatSpringGameJam))
|
||||||
|
@ -38,7 +38,7 @@ MLEM's [text formatting system](https://mlem.ellpeck.de/articles/text_formatting
|
||||||
![An image showing text with various colors and other formatting](https://raw.githubusercontent.com/Ellpeck/MLEM/release/Media/Formatting.png)
|
![An image showing text with various colors and other formatting](https://raw.githubusercontent.com/Ellpeck/MLEM/release/Media/Formatting.png)
|
||||||
|
|
||||||
# Friends of MLEM
|
# Friends of MLEM
|
||||||
There are several other libraries and tools that work well in combination with MonoGame and MLEM. Here are some of them:
|
There are several other libraries and tools that work well in combination with MonoGame, FNA and MLEM. Here are some of them:
|
||||||
- [Contentless](https://github.com/Ellpeck/Contentless), a tool that removes the need to add assets to the MonoGame Content Pipeline manually
|
- [Contentless](https://github.com/Ellpeck/Contentless), a tool that removes the need to add assets to the MonoGame Content Pipeline manually
|
||||||
- [GameBundle](https://github.com/Ellpeck/GameBundle), a tool that packages MonoGame and other .NET Core applications into several distributable formats
|
- [GameBundle](https://github.com/Ellpeck/GameBundle), a tool that packages MonoGame and other .NET Core applications into several distributable formats
|
||||||
- [MonoGame.Extended](https://github.com/craftworkgames/MonoGame.Extended), a package that also provides several additional features for MonoGame
|
- [MonoGame.Extended](https://github.com/craftworkgames/MonoGame.Extended), a package that also provides several additional features for MonoGame
|
||||||
|
|
|
@ -41,6 +41,12 @@ namespace MLEM.Formatting.Codes {
|
||||||
batch.Draw(this.image.CurrentRegion, new RectangleF(pos, new Vector2(font.LineHeight * scale)), actualColor);
|
batch.Draw(this.image.CurrentRegion, new RectangleF(pos, new Vector2(font.LineHeight * scale)), actualColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public override bool DrawCharacter(GameTime time, SpriteBatch batch, char c, string cString, Token token, int indexInToken, ref Vector2 pos, GenericFont font, ref Color color, ref float scale, float depth) {
|
||||||
|
// we don't want to draw the first (space) character (in case it is set to a missing character in FNA)
|
||||||
|
return indexInToken == 0;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -9,7 +9,7 @@ using MLEM.Formatting.Codes;
|
||||||
namespace MLEM.Misc {
|
namespace MLEM.Misc {
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// MlemPlatform is a wrapper around some of MonoGame's platform-dependent behavior to allow for MLEM to stay platform-independent.
|
/// MlemPlatform is a wrapper around some of MonoGame's platform-dependent behavior to allow for MLEM to stay platform-independent.
|
||||||
/// See <see cref="DesktopGl{T}"/>, <see cref="Mobile"/> and <see cref="None"/> for information on the specific platforms.
|
/// See <see cref="DesktopGl{T}"/>, <see cref="DesktopFna"/>, <see cref="Mobile"/> and <see cref="None"/> for information on the specific platforms.
|
||||||
/// The MLEM demos' main classes also make use of this functionality: https://github.com/Ellpeck/MLEM/blob/main/Demos.DesktopGL/Program.cs#L8 and https://github.com/Ellpeck/MLEM/blob/main/Demos.Android/Activity1.cs#L33.
|
/// The MLEM demos' main classes also make use of this functionality: https://github.com/Ellpeck/MLEM/blob/main/Demos.DesktopGL/Program.cs#L8 and https://github.com/Ellpeck/MLEM/blob/main/Demos.Android/Activity1.cs#L33.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public abstract class MlemPlatform {
|
public abstract class MlemPlatform {
|
||||||
|
@ -63,7 +63,7 @@ namespace MLEM.Misc {
|
||||||
public delegate void TextInputCallback(object sender, Keys key, char character);
|
public delegate void TextInputCallback(object sender, Keys key, char character);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The MLEM DesktopGL platform.
|
/// The MLEM DesktopGL platform, which is also compatible with other desktop distributions of MonoGame, like WindowsDX.
|
||||||
/// This platform uses the built-in MonoGame TextInput event, which makes this listener work with any keyboard localization natively.
|
/// This platform uses the built-in MonoGame TextInput event, which makes this listener work with any keyboard localization natively.
|
||||||
/// This platform is initialized as follows:
|
/// This platform is initialized as follows:
|
||||||
/// <code>
|
/// <code>
|
||||||
|
|
14
README.md
14
README.md
|
@ -11,12 +11,12 @@
|
||||||
- See [the changelog](https://github.com/Ellpeck/MLEM/blob/main/CHANGELOG.md) for information on updates
|
- See [the changelog](https://github.com/Ellpeck/MLEM/blob/main/CHANGELOG.md) for information on updates
|
||||||
|
|
||||||
# Packages
|
# Packages
|
||||||
- **MLEM** is the base package, which provides extension methods and additional features for MonoGame
|
- **MLEM** is the base package, which provides extension methods and additional features for MonoGame and FNA.
|
||||||
- **MLEM.Ui** features a mouse, keyboard, gamepad and touch ready Ui system that features automatic anchoring, sizing and several ready-to-use element types
|
- **MLEM.Ui** features a mouse, keyboard, gamepad and touch ready Ui system that features automatic anchoring, sizing and several ready-to-use element types.
|
||||||
- **MLEM.Extended** ties in with MonoGame.Extended and other MonoGame libraries
|
- **MLEM.Extended** ties in with MonoGame.Extended and other MonoGame and FNA libraries.
|
||||||
- **MLEM.Data** provides simple loading and processing of textures and other data, including the ability to load non-XNB content files easily
|
- **MLEM.Data** provides simple loading and processing of textures and other data, including the ability to load non-XNB content files easily.
|
||||||
- **MLEM.Startup** combines MLEM with some other useful libraries into a quick Game startup class
|
- **MLEM.Startup** combines MLEM with some other useful libraries into a quick Game startup class.
|
||||||
- **MLEM.Templates** contains cross-platform project templates
|
- **MLEM.Templates** contains cross-platform project templates.
|
||||||
|
|
||||||
# Made with MLEM
|
# Made with MLEM
|
||||||
- [A Breath of Spring Air](https://ellpeck.itch.io/a-breath-of-spring-air), a short platformer ([Source](https://git.ellpeck.de/Ellpeck/GreatSpringGameJam))
|
- [A Breath of Spring Air](https://ellpeck.itch.io/a-breath-of-spring-air), a short platformer ([Source](https://git.ellpeck.de/Ellpeck/GreatSpringGameJam))
|
||||||
|
@ -38,7 +38,7 @@ MLEM's [text formatting system](https://mlem.ellpeck.de/articles/text_formatting
|
||||||
![An image showing text with various colors and other formatting](https://raw.githubusercontent.com/Ellpeck/MLEM/main/Media/Formatting.png)
|
![An image showing text with various colors and other formatting](https://raw.githubusercontent.com/Ellpeck/MLEM/main/Media/Formatting.png)
|
||||||
|
|
||||||
# Friends of MLEM
|
# Friends of MLEM
|
||||||
There are several other libraries and tools that work well in combination with MonoGame and MLEM. Here are some of them:
|
There are several other libraries and tools that work well in combination with MonoGame, FNA and MLEM. Here are some of them:
|
||||||
- [Contentless](https://github.com/Ellpeck/Contentless), a tool that removes the need to add assets to the MonoGame Content Pipeline manually
|
- [Contentless](https://github.com/Ellpeck/Contentless), a tool that removes the need to add assets to the MonoGame Content Pipeline manually
|
||||||
- [GameBundle](https://github.com/Ellpeck/GameBundle), a tool that packages MonoGame and other .NET Core applications into several distributable formats
|
- [GameBundle](https://github.com/Ellpeck/GameBundle), a tool that packages MonoGame and other .NET Core applications into several distributable formats
|
||||||
- [MonoGame.Extended](https://github.com/craftworkgames/MonoGame.Extended), a package that also provides several additional features for MonoGame
|
- [MonoGame.Extended](https://github.com/craftworkgames/MonoGame.Extended), a package that also provides several additional features for MonoGame
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
<Content Include="Content/**">
|
<Content Include="Content/**">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</Content>
|
</Content>
|
||||||
<Content Include="FNA/**">
|
<Content Include="FnaNative/**">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
<Link>%(Filename)%(Extension)</Link>
|
<Link>%(Filename)%(Extension)</Link>
|
||||||
</Content>
|
</Content>
|
||||||
|
|
Loading…
Reference in a new issue