UrhoSharp support for Xamarin.Mac

I have downloaded UrhoSharp samples and got them working both on WPF and Mac. WPF one, it shows integration into a GUI app using WindowsFormsHost.

However, I am trying to do a Xamarin.MAC application that has an UI built using storyboards. I could not find an example showing the integration of the UrhoSharp with the ViewControllers.

Can you let me know if this scenario is supported. if so, could you kindly point me towards a sample application.

Answers

  • xamdevxamdev GBMember
    edited September 2016

    Hello Team,

    I really hope that Xamarin /someone else from community, could provide a sample to demonstrate UrhoSharp being used as part of a proper CocoaApp in Mac. There are number of samples from urho-sample repository, They are useful to learn to use inner concepts. However, integration point is messy.

    I am building a Xamarin Mac GUI application where I need to embed UrhoSharp as part of one of the viewcontrollers..

    1. I have created a CocoaApp in Mac.
    2. And, changed the targeting to 4.5 framework.
    3. And, I am trying to do the following to inject one of the views into the Xamarin App. However, first hurdle, it complained that assets folder was missing. And, add the data folder from assets under resources. However, next run, it is complaining that CoreData.pak missing. And, I have added the coredata.pak file to resources folder and it gave me the following error.
      >
      >
      > Sharing violation on path /Users/sriharikothapalli/urho-samples/FeatureSamples/app2/bin/Debug/app2.app/Contents/Resources/CoreData.pak" or "./CoreData.pak

    _> public override void DidFinishLaunching(NSNotification notification)

    {
    Type selectedSampleType = typeof(HelloWorld);

    var currentPath = System.IO.Path.GetFullPath(".");

    DesktopUrhoInitializer.AssetsDirectory = @../../assets;
    var game = (Application)Activator.CreateInstance(selectedSampleType, new ApplicationOptions("Data"));
    var exitCode = game.Run();

    }_

  • EgorBoEgorBo ✭✭✭ BYXamarin Team ✭✭✭

    @xamdev I'll add a sample of UrhoSharp + Cocoa soon. As far as I remember you can use it like this:

        var myApp = new myApp(new ApplicationOptions("MyData") { ExternalWindow = myNSView.Handle });
        myApp.Run();
    
  • xamdevxamdev GBMember

    Hi Egor,

    Thank you very much for responding.

    Just wanted to be clear - by meaning of support, it works as a control within the cocoa application.

    So, if I have a split window where on the left hand side if I have the game name, and clicking on it, opens the game on the right hand side? Just as we are currently doing WPF sample.

    I have tried the code given, but it errors about coredata.pak not found.

  • EgorBoEgorBo ✭✭✭ BYXamarin Team ✭✭✭

    Exactly, I'll create a copy of the WPF sample in Cocoa (control - is just a NSView).

  • xamdevxamdev GBMember

    Thats great Egor. No pressure, but, how soon it may happen.

    We are eagerly waiting for this to verified before making a decision on chosing the right technology particularly interested in urhosharp

  • xamdevxamdev GBMember

    Hi Egor,

    Can you give some ETA for this very simple example. I was hoping this only takes few minutes to complete for you. Really need this urgently to move further on this.

Sign In or Register to comment.