1
0
Fork 0
mirror of https://github.com/Ellpeck/MLEM.git synced 2024-11-24 13:38:34 +01:00

Compare commits

...

4 commits

Author SHA1 Message Date
Ell
b6882a879b Merge branch 'release' into main 2021-10-24 00:36:03 +02:00
Ell
e4bd6adc55 some docs link fixes 2021-10-24 00:35:32 +02:00
Ell
4d2d33a781 some docs link fixes 2021-10-24 00:30:50 +02:00
Ell
9a480d391b some MlemPlatform doc clarifications and improvements 2021-10-23 22:05:32 +02:00
5 changed files with 11 additions and 15 deletions

View file

@ -1,9 +1,9 @@
# MLEM.Startup
**MLEM.Startup** is a simple package that contains a `MlemGame` class which extends MonoGame's `Game`. This class contains additional properties that most games created with MonoGame and MLEM will have:
- An [InputHandler](https://github.com/Ellpeck/MLEM/wiki/Input-Handler)
- An [InputHandler](xref:MLEM.Input.InputHandler)
- A `SpriteBatch` and `GraphicsDeviceManager`
- A [UiSystem](https://github.com/Ellpeck/MLEM/wiki/MLEM.Ui)
- A [UiSystem](ui.md)
- Some delegate callbacks for loading, updating and drawing that allow additional code to be executed from outside the game class
Additionally, it comes with the [Coroutine](https://www.nuget.org/packages/Coroutine) package preinstalled. The Coroutine package allows creating and running operations alongside the regular game loop without asynchrony. It comes with a `CoroutineEvents` class that contains two types of events that are automatically invoked by `MlemGame`. For more information on how this is useful, see [the Coroutine README](https://github.com/Ellpeck/Coroutine/blob/main/README.md).

View file

@ -4,7 +4,7 @@ The **MLEM** package contains a simple text formatting system that supports colo
Text formatting makes use of [generic fonts](font_extensions.md).
It should also be noted that [MLEM.Ui](https://github.com/Ellpeck/MLEM/wiki/MLEM.Ui)'s `Paragraph`s support text formatting out of the box.
It should also be noted that [MLEM.Ui](ui.md)'s `Paragraph`s support text formatting out of the box.
*This documentation is about the new text formatting that was introduced in MLEM 3.3.1. You can see the documentation for the legacy text formatting system [here](text_formatting_legacy.md).*

View file

@ -4,7 +4,7 @@ The **MLEM** package contains a simple text formatting system that supports colo
Text formatting makes use of [generic fonts](font_extensions.md).
It should also be noted that [MLEM.Ui](https://github.com/Ellpeck/MLEM/wiki/MLEM.Ui)'s `Paragraph`s support text formatting out of the box.
It should also be noted that [MLEM.Ui](ui.md)'s `Paragraph`s support text formatting out of the box.
## Formatting codes
To format your text, you can insert *formatting codes* into it. These codes are surrounded by `[]` by default, however these delimiters can be changed like so:
@ -23,7 +23,7 @@ By default, the following formatting options are available:
## Getting your text ready
To actually display the text with formatting, you first need to gather the formatting data from the text. For performance reasons, this is best done when the text changes, and not every render frame.
To gather formatting data, you will need a [generic font](https://github.com/Ellpeck/MLEM/wiki/Font-Extensions). With it, you can gather the data in the form of a `FormattingCodeCollection` like so:
To gather formatting data, you will need a [generic font](font_extensions.md). With it, you can gather the data in the form of a `FormattingCodeCollection` like so:
```cs
var font = new GenericSpriteFont(this.Content.Load<SpriteFont>("Fonts/ExampleFont"));
var text = "This is the [Blue]text[White] that should be [Wobbly]formatted[Unanimated].";

4
Jenkinsfile vendored
View file

@ -5,7 +5,7 @@ pipeline {
steps {
sh 'dotnet tool restore'
// we use xvfb to allow for graphics-dependent tests
sh 'xvfb-run -a dotnet dotnet-cake --Target=Publish --Branch=' + env.BRANCH_NAME
sh 'xvfb-run -a dotnet cake --target Publish --branch ' + env.BRANCH_NAME
}
}
stage('Document') {
@ -13,7 +13,7 @@ pipeline {
branch 'release'
}
steps {
sh 'dotnet dotnet-cake --Target=Document'
sh 'dotnet cake --target Document'
sh 'cp Docs/_site/** /var/www/MLEM/ -r'
}
}

View file

@ -66,13 +66,11 @@ namespace MLEM.Misc {
/// <summary>
/// The MLEM DesktopGL platform.
/// This platform uses the built-in MonoGame TextInput event, which makes this listener work with any keyboard localization natively.
/// </summary>
/// <example>
/// This platform is initialized as follows:
/// <code>
/// new MlemPlatform.DesktopGl{TextInputEventArgs}((w, c) => w.TextInput += c)
/// MlemPlatform.Current = new MlemPlatform.DesktopGl&lt;TextInputEventArgs&gt;((w, c) => w.TextInput += c);
/// </code>
/// </example>
/// </summary>
/// <typeparam name="T"></typeparam>
public class DesktopGl<T> : MlemPlatform {
@ -116,13 +114,11 @@ namespace MLEM.Misc {
/// The MLEM platform for mobile platforms as well as consoles.
/// This platform opens an on-screen keyboard using the <see cref="Microsoft.Xna.Framework.Input"/> <c>KeyboardInput</c> class on mobile devices.
/// Additionally, it starts a new activity whenever <see cref="OpenLinkOrFile"/> is called.
/// </summary>
/// <example>
/// This listener is initialized as follows in the game's <c>Activity</c> class:
/// <code>
/// new MlemPlatform.Mobile(KeyboardInput.Show, l =&gt; this.StartActivity(new Intent(Intent.ActionView, Uri.Parse(l))))
/// MlemPlatform.Current = new MlemPlatform.Mobile(KeyboardInput.Show, l =&gt; this.StartActivity(new Intent(Intent.ActionView, Uri.Parse(l))));
/// </code>
/// </example>
/// </summary>
public class Mobile : MlemPlatform {
private readonly OpenOnScreenKeyboardDelegate openOnScreenKeyboard;