Introduction to UrhoSharp in Xamarin Forms

UrhoSharp.Forms is a Xamarin Forms component that enables cross platform development using Urho3D, a lightweight and powerful 3D Game Engine. UrhoSharp.Forms uses the UrhoSharp Xamarin Libraries, which are bindings for the community based Urho3D project.


Getting Started

UrhoSharp supports iOS, Android and UWP. Xamarin has provided a UrhoSharp Template that you can use, however I am going to start from the ground, and/or the basis of extending an existing Xamarin Forms application.

  1. Create a regular Xamarin Forms portable project.
  2. Install UrhoSharp.Forms in your platform and PCL projects.

Demo Project: If you want to follow along I have a completed UrhoSharp.Demo project.


The UrhoSurface is the Xamarin.Forms view that houses the Urho3D content. Now we will add a UrhoSurface to our MainPage. In MainPage.xaml.cs add the following.

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns=""

    <urho:UrhoSurface x:Name="HelloWorldUrhoSurface" VerticalOptions="FillAndExpand" />


Urho Application

We must now create an Application to put inside our UrhoSurface. Create a new class called HelloWorld.cs in the portable library.

 public class HelloWorld: Urho.Application

Assign this to the Surface by going back to your MainPage.xaml.cs and OnAppearing, call the Show method.

protected override async void OnAppearing()

    await HelloWorldUrhoSurface.Show<HelloWorld>(new Urho.ApplicationOptions(assetsFolder: null));

The application loads in the UrhoSurface but your application has nothing in it. We are now going to add some text to the application.

UI Root Elements

In your HelloWorld.cs you override the Start method and create a new function to show some text.

public class HelloWorld : Application
    protected override void Start()

    private void CreateText()
        // Create Text Element
        var text = new Text()
            Value = "Hello World!",
            HorizontalAlignment = HorizontalAlignment.Center,
            VerticalAlignment = VerticalAlignment.Center

        text.SetFont(font: ResourceCache.GetFont("Fonts/Anonymous Pro.ttf"), size: 30);
        // Add to UI Root



Continuing On

We finally made the most basic app possible with UrhoSharp.Forms. Moving on to 3D objects, we have to create a Scene, load components and perform action. In my post UrhoSharp 3D Moving Object, I go step by step through creating a spinning pyramid.

One Comment

  1. Vivek

    Greatest ever getting started program I have found for urho sharp. Thank you Adam.Please share other examples also if you can.