urho icon indicating copy to clipboard operation
urho copied to clipboard

Transparent background - again - for Xam Forms -VERY IMPORTANT!

Open IssacKramer opened this issue 8 years ago • 1 comments

@EgorBo Hi Egor. I'm asking you this feature again although i saw you closed it few months ago, because THIS FEATURE IS VERY IMPORTANT for Xamarin Forms integration! Every xam forms developer who wants to add extra animation to XF can use UrhoSharp. BUT, if the background of the UrhoSurface is black (or different from the XF page) the outcome is ugly or unacceptable.

So, this feature is enabling the use of UrhoSharp not only for game developers but also to XF developers even if they are newbies.

For example, I want to add animation of gold sparkling stars to XF controls on the page. I cannot do this without UrHoSurface background=Color.Transparent also, this feature is very requested:

1.https://stackoverflow.com/questions/45319316/urho-forms-transparent-background 2. https://stackoverflow.com/questions/46092650/how-can-i-make-urho3d-background-become-transparent-in-xamarin-form 3. https://forums.xamarin.com/discussion/63103/how-to-change-background-color 4. https://forums.xamarin.com/discussion/102727/how-to-make-a-transparent-background 5. https://forums.xamarin.com/discussion/97630/render-with-a-transparent-background this is probably from the same reason.

I saw your example in https://github.com/EgorBo/ARKitXamarinDemo but it is very complex (for newbie in urho at least) and XF developer needs to have code like: urhoSurface.BackgroundColor=Color.Transparent; Done!

So , if you can upgrade this feature priority it would be great!

Also from what i red in forums , there is a problem to do transparency on windows , android and ios so this feature should be checked carefully on all platform.

Can you do that please? Thanks. Issac Kramer.

IssacKramer avatar Dec 05 '17 09:12 IssacKramer

I am not sure it's possible with urho - the Engine needs to "clean" the surface before rendering a next frame. Usually this color is black but can be changed to any other color (for example, a color of the background panel in Xamarin.Forms). app.Renderer.GetViewport(0).SetClearColor(Color.Red);

But you can not render Urho on top of buttons, labels and so on - the only way is to make a screenshot of the underlying Xamarin.Forms layout every frame and use it as a background in urho (like it was done for Urho ARKit) - but it sounds very inefficient. I'll try to test.

EgorBo avatar Feb 27 '18 22:02 EgorBo