Archive 17/01/2023.

Xamarin android urhosharp has no octree.getdrawables

tianlv777

xamarin android urhosharp has no octree.getdrawables
how to solve

Eugene

I say you poke @elix22, they are the closest thing to UrhoSharp “maintainer” out there.

tianlv777

please help me,I don’t know how to poke elix22

George1

Here is the .net version.

tianlv777

I saw the Urho.Net,And try use.But Urho.Net scene.GetComponent().getdrawables is alos not finded.
So what is right way.I could using octree.getdrawables function.

tianlv777

elix22

Create an issue on Github .
I am not promising anything , I will see what I can do.

Please note that on mobile devices (unlike UrhoSharp) Urho.Net is not linked to
Xamarin Android/iOS , it’s running directly on top of Mono runtime.

tianlv777

0 0,I mean if there are no has other easy way to do octreee.getdrawables.It means we can not get Nodes within a rectangle by octree of urho3d.So I want add my logic to do this function.Just like War3 Game,I just want to get units by rectangle.

tianlv777

Now I could use Urho.Net to run “android-deploy-debug”.But I can’t debug with breakpoint.I use Win10.And .net core debug is ok,I could use breakpoint.But in “android-deploy-debug” ,breakpoint is invalid.Just Samples.

tianlv777

elix22

Currently Debugger is available only on Desktop (Windows , Linux, MacOS)
You can use Logs , it’s working on all platforms .

using Urho.IO;

Log.LogLevel = LogLevel.Info;

Log.Info("Some test log with a number " + 10.ToString() + " and a nother number" + 456.ToString());
tianlv777


tianlv777

chinese is bad on C#.NET
bUT OK ON XAMARIN urhosharp。
private void StartMainScene()
{
// _mainScene?.Destroy();
// _mainScene = new MainScene(Graphics.Width, Graphics.Height);
Current.UI.Root.RemoveAllChildren();
var cache = ResourceCache;
var helloText = new Text()
{
Value = “平行世界Parallel World”,
HorizontalAlignment = HorizontalAlignment.Center,
VerticalAlignment = VerticalAlignment.Center
};
// helloText.Position = new IntVector2(500, 100);
helloText.SetColor(Color.FromByteFormat((byte)11, (byte)239, (byte)239, (byte)255));
helloText.SetFont(font: cache.GetFont(“Fonts/siyuanheiti.otf”), size: 77);
UI.Root.AddChild(helloText);

	}
tianlv777

font could download

elix22

Hmm …
I don’t think it ever worked .
On what Xamarin UrhoSharp Version did you try , I checked it on UrhoSharp and it’s even worse than Urho.Net.
You can open an issue on Urho.Net Github , I will look into it once I will have some free time.

tianlv777

xamarin.android visual studio 2022
so I just want a bridge ,I could Packaging C++ source code about urho to nuget.
So I could use C#.urho ,and other nuget pakage in xamarin.android- -???
urhosharp is in disrepair

so I don‘t know how to modify c++ source code about urho .
then let nuget work in c# in xamarin.android.

tianlv777

now I could run C++ urho sample well in windows visual studio 2022.
the code is from GitHub - urho3d/urho3d: Game engine


elix22

This is a big and very very very … complicated work .
Compiling only the C++ part with VS2022 is not sufficant :slight_smile:

Although Xamarin UrhoSharp is a dead project , you can browse the source code and figure out the way it was implemented (I did the same thing when I implemented Urho.NET.)

Specifically you will have to check the bindings folder and how to generate them .
You will need an Apple computer for binding generation .
But compiling them to .NET assembly can be done on any Operation system on any PC.

In addition for Xamarin.Android , you will have to figure out the interaction between the Xamarin.Android runtime and SDL (Urho3D is running on top of SDL) .(urho/Bindings/Android at master · xamarin/urho · GitHub)

elix22

I have created Urho.Net Xamarin & Xamarin.Forms binaries/assemblies based upon my latest code …
You can find the binaries and assemblies in this link :
Urho3D/Xamarin at xamarin · elix22/Urho3D · GitHub

For Xamarin.Android
Assemblies to reference
Urho.Droid.SdlBinding.dll
Urho.Xamarin.dll

Native Libraries to add , libs

For Xamarin.IOS
Assembly to reference Urho.Xamarin.dll
Native library to link ,libUrho3D-GLES.a

For Xamarin.Forms
Assemblies
Android Urho.Droid.SdlBinding.dll , Urho.Xamarin.Forms.dll
iOS Urho.Xamarin.Forms.dll
Common (PCL) Urho.Xamarin.Forms.dll
Native libraries
Android libs
IOS libUrho3D-GLES.a

I assume you know how to use these in your Xamarin projects.
Assemblies just have to be referenced as any other assembly
Native libraries , Some tutorial links
ios/platform/native-interop
android/platform/native-libraries

Currently there is no Nuget package , I will create it once I will have some time
Please note that I don’t provide any support , if you find any bugs you can open an issue on my Github but I don’t promise to fix them.