![]() |
VOOZH | about |
dotnet add package Lofty.Core --version 1.0.0
NuGet\Install-Package Lofty.Core -Version 1.0.0
<PackageReference Include="Lofty.Core" Version="1.0.0" />
<PackageVersion Include="Lofty.Core" Version="1.0.0" />Directory.Packages.props
<PackageReference Include="Lofty.Core" />Project file
paket add Lofty.Core --version 1.0.0
#r "nuget: Lofty.Core, 1.0.0"
#:package Lofty.Core@1.0.0
#addin nuget:?package=Lofty.Core&version=1.0.0Install as a Cake Addin
#tool nuget:?package=Lofty.Core&version=1.0.0Install as a Cake Tool
Lofty Core is a .NET MAUI graphics and input library inspired by the ActionScript 3 display API. It gives MAUI apps a SkiaSharp-backed display list with familiar stage, sprite, shape, bitmap, text, event, geometry, and MIDI building blocks.
The library targets .NET 10 MAUI platforms and is designed for interactive rendered experiences that need a Flash/AS3-style scene model on top of Skia.
Stage, DisplayObject, DisplayObjectContainer, Sprite, Shape, Bitmap, BitmapData, MovieClip, and SimpleButton.Graphics using fills, strokes, paths, rectangles, rounded rectangles, circles, ellipses, quadratic curves, and cubic curves.SkiaStageViewHost, which connects a Stage to a MAUI SKCanvasView.TextField, including selection, caret, clipboard hooks, password display, wrapping, and alignment.UIContainer, horizontal/vertical/dock layout modes, padding, gaps, margins, percent sizing, and min/max sizing.ScrollContainer.Point, Rectangle, Matrix, and Vector3D.IMidiService.The project currently targets:
net10.0-androidnet10.0-ios on non-Linux hostsnet10.0-maccatalyst on non-Linux hostsnet10.0-windows10.0.19041.0 on Windows hostsMinimum platform versions are configured in Lofty.Core.csproj:
Core package references:
Microsoft.Maui.ControlsSkiaSharp.Views.Maui.Controlsmanaged-midiRtMidi.CoreFrom the repository root:
dotnet workload restore
dotnet build .\Lofty.Core.slnx -c Release
During day-to-day development on Windows, you can target the Windows framework directly:
dotnet build .\Lofty.Core\Lofty.Core.csproj -c Release -f net10.0-windows10.0.19041.0
The project has GeneratePackageOnBuild enabled, so Release builds also produce a NuGet package under the project bin output.
Reference the project from a MAUI app:
<ItemGroup>
<ProjectReference Include="..\Lofty.Core\Lofty.Core.csproj" />
</ItemGroup>
Create a stage, attach it to an SKCanvasView, and add display objects:
using Lofty.Core.Display;
using Lofty.Core.Events;
using Microsoft.Maui.Controls;
using SkiaSharp;
using SkiaSharp.Views.Maui.Controls;
public partial class MainPage : ContentPage
{
private readonly Stage _stage;
private readonly SkiaStageViewHost _host;
public MainPage()
{
InitializeComponent();
var canvas = new SKCanvasView();
Content = canvas;
_stage = new Stage(800, 480)
{
BackgroundColor = SKColors.Black
};
var button = new Sprite
{
X = 100,
Y = 100,
ButtonMode = true,
UseHandCursor = true
};
button.Graphics.BeginFill(0x2B8CFF);
button.Graphics.DrawRoundRect(0, 0, 180, 80, 12, 12);
button.Graphics.EndFill();
button.AddEventListener(EventTypes.Click, _ =>
{
button.Rotation += 15;
});
_stage.AddChild(button);
_host = new SkiaStageViewHost(canvas, _stage)
{
ScaleMode = StageScaleMode.ShowAll,
TargetFps = 60
};
}
protected override void OnDisappearing()
{
_host.Dispose();
_stage.Dispose();
base.OnDisappearing();
}
}
Shape and Sprite expose a Graphics instance:
var shape = new Shape
{
X = 40,
Y = 40
};
shape.Graphics.LineStyle(2, 0xFFFFFF);
shape.Graphics.BeginFill(0xFFCC00);
shape.Graphics.DrawCircle(50, 50, 40);
shape.Graphics.EndFill();
stage.AddChild(shape);
Display objects inherit from EventDispatcher. For display-list objects, events can capture, target, and bubble through the parent chain.
shape.AddEventListener(EventTypes.MouseDown, e =>
{
e.StopPropagation();
});
stage.AddEventListener(
EventTypes.Click,
e => Console.WriteLine($"Clicked {e.Target}"),
useCapture: true,
priority: 10);
Common event groups include:
added, removed, addedToStage, removedFromStageenterFrame, render, resize, invalidatemouseDown, mouseMove, mouseUp, mouseWheel, click, doubleClicktouchBegin, touchMove, touchEnd, touchTap, touchCancelgesturePan, gestureZoom, gestureRotate, gestureSwipekeyDown, keyUp, focusIn, focusOutTextField supports dynamic text and editable input:
var input = new TextField
{
Type = TextFieldType.Input,
Width = 280,
Height = 48,
Background = true,
Border = true,
FontSize = 18,
Text = "Edit me"
};
input.AddEventListener(EventTypes.Change, _ =>
{
Console.WriteLine(input.Text);
});
stage.AddChild(input);
For platform clipboard integration, assign ClipboardRead and ClipboardWrite.
Register the MIDI service in your MAUI app builder:
using Lofty.Core.Services;
builder.Services.AddMidi();
Consume IMidiService from dependency injection:
using Lofty.Core.Media;
public sealed class MidiMonitor
{
private readonly IMidiService _midi;
public MidiMonitor(IMidiService midi)
{
_midi = midi;
_midi.DeviceConnected += device => Console.WriteLine($"MIDI connected: {device.Name}");
_midi.NoteOn += note => Console.WriteLine($"Note on: {note.Note} velocity {note.Velocity}");
}
public void Start() => _midi.Start();
public void Stop() => _midi.Stop();
}
Current MIDI implementation status:
Android.Media.Midi.Lofty.Core/
Display/ Stage, display objects, graphics, text, layout, scrolling, Skia host
Events/ Event model, event types, input, mouse, touch, gesture, keyboard, focus
Geom/ Point, Rectangle, Matrix, Vector3D
Media/ MIDI models and service abstraction
Platforms/ Platform-specific MIDI service implementations
Services/ MAUI service registration extensions
AllowUnsafeBlocks is enabled for the Windows MIDI callback path.Lofty.Core.csproj.| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0-android36.0 net10.0-android36.0 is compatible. net10.0-ios26.0 net10.0-ios26.0 is compatible. net10.0-maccatalyst26.0 net10.0-maccatalyst26.0 is compatible. net10.0-windows10.0.19041 net10.0-windows10.0.19041 is compatible. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0 | 122 | 5/31/2026 |