Plugin.Maui.XTiltIndicator 1.0.1

dotnet add package Plugin.Maui.XTiltIndicator --version 1.0.1
                    
NuGet\Install-Package Plugin.Maui.XTiltIndicator -Version 1.0.1
                    
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="Plugin.Maui.XTiltIndicator" Version="1.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Plugin.Maui.XTiltIndicator" Version="1.0.1" />
                    
Directory.Packages.props
<PackageReference Include="Plugin.Maui.XTiltIndicator" />
                    
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 Plugin.Maui.XTiltIndicator --version 1.0.1
                    
#r "nuget: Plugin.Maui.XTiltIndicator, 1.0.1"
                    
#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 Plugin.Maui.XTiltIndicator@1.0.1
                    
#: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=Plugin.Maui.XTiltIndicator&version=1.0.1
                    
Install as a Cake Addin
#tool nuget:?package=Plugin.Maui.XTiltIndicator&version=1.0.1
                    
Install as a Cake Tool

Plugin.Maui.XTiltIndicator

XPitchIndicator is a MAUI control for displaying the device's tilt (pitch) in both horizontal and vertical axes. It supports two display modes: Gauge (semi-circular arc with indicator) and Bars (horizontal/vertical bars). Ideal for flight simulators, technical instruments, HUDs, or any app that needs to visualize device orientation.


Overlay Screenshot

Features

  • Supports HorizontalPitch and VerticalPitch.
  • Display modes: Gauge or Bars.
  • Customizable colors for the indicator and zero line.
  • Optional numeric display of pitch value.
  • Smooth motion with easing (lerp) for natural transitions.
  • Built on GraphicsView for optimal performance.
  • Uses the device accelerometer to calculate pitch angles.

Installation

Install via NuGet:

dotnet add package Plugin.Maui.XTiltIndicator --version 1.0.1

Configuration

Add UseXTiltIndicator() inside MauiProgram >>> MauiApp CreateMauiApp()

     public static MauiApp CreateMauiApp() {
        var builder = MauiApp.CreateBuilder();
        builder
            .UseMauiApp<App>()
            .UseXTiltIndicator() //<<< This line

You can customize the control by setting its bindable properties in XAML or C#.

Example XAML

<Grid BackgroundColor="White">
    <xctrls:XPitchIndicator
        HorizontalOptions="Fill"
        VerticalOptions="Fill"
        PitchColor="Red"
        PitchZeroColor="Lime"
        HorizontalPitch="Gauge"
        VerticalPitch="Gauge"
        ShowHorizontalPitchValue="False"/>
        
    <Label Text="Your content" HorizontalOptions="Center" />
</Grid>

Example C# Usage

using Plugin.Maui.XTiltIndicator;

var pitchIndicator = new XPitchIndicator
{
    HorizontalOptions = LayoutOptions.Fill,
    VerticalOptions = LayoutOptions.Fill,
    PitchColor = Colors.Red,
    PitchZeroColor = Colors.Lime,
    HorizontalPitch = TPitchType.Gauge,
    VerticalPitch = TPitchType.Gauge,
    ShowHorizontalPitchValue = false
};

var grid = new Grid { BackgroundColor = Colors.White };
grid.Children.Add(pitchIndicator);
grid.Children.Add(new Label 
{ 
    Text = "Your content", 
    HorizontalOptions = LayoutOptions.Center 
});

Content = grid;

Bindable Properties

Property Type Default Description
PitchColor Color Lime Sets the color of the pitch indicator and major tick marks. Example: Red.
PitchZeroColor Color Red Sets the color of the zero line for horizontal and vertical scales. Example: Lime.
HorizontalPitch TPitchType Gauge Display mode for horizontal pitch. Options: Gauge (semi-circle) or Bars.
VerticalPitch TPitchType Gauge Display mode for vertical pitch. Options: Gauge or Bars.
ShowHorizontalPitchValue bool true Show numeric horizontal pitch value above the semicircular gauge. Set to False to hide.

Smooth Motion / Easing

The control applies a linear interpolation (lerp) to smooth the movement of the indicator when pitch values change. This creates a natural, analog-style motion, avoiding abrupt jumps from sensor updates.


Notes

  • On emulators, accelerometer values may not be exactly zero due to simulation offsets.
  • Tested on Android, iOS, and Windows MAUI apps.
  • For best results, test on a real device.

License

MIT License. Free to use and modify.

Product Compatible and additional computed target framework versions.
.NET net9.0-android35.0 is compatible.  net9.0-ios18.0 is compatible.  net9.0-maccatalyst18.0 is compatible.  net9.0-windows10.0.19041 is compatible.  net10.0-android was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-windows was computed. 
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
1.0.1 86 11/7/2025
1.0.0 118 11/5/2025