Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is still not possible to work with a canvas? #417

Open
SoleR7 opened this issue Apr 23, 2019 · 6 comments
Open

Is still not possible to work with a canvas? #417

SoleR7 opened this issue Apr 23, 2019 · 6 comments

Comments

@SoleR7
Copy link

SoleR7 commented Apr 23, 2019

Hello @KojiNakamaru and everyone, I would like to know if is still not possible to work with a canvas with buttons or whatever in the same scene as where the WebView is.

Here you can see that I have move the margins and WebView Buttons, but behind the first one I have a buton from a canvas, which is not possible to click.

imagen1

In the next screenshot I have tried to "hide" the WebView in the second button with webViewObject.enabled = false; but doesnt respond.
With the first button (the one with Destroy(); ) It hides but I'm still not able to click any of the buttons.
imagen2

So there's any solution or workaround for this, any way of use canvas elements?
Do I will have to work with GUI buttons only?
Thanks :)

@KojiNakamaru
Copy link
Member

The sample app defines buttons (by Legacy GUI system) simply as an example. You can remove them. The plugin however places webviews over Unity's rendering view so that you cannot place, for example, a uGUI button over webviews.

webViewObject.enabled = false;

If you call webViewObject.SetVisibility(false) you should be able to click the button.

@SoleR7
Copy link
Author

SoleR7 commented Apr 23, 2019

As you said, setting the visibility to false works, but the buttons are still not clickable, like in the screenshot I have attach in the post the buttons remain a "layer" behind the GUI buttons.
I have also tried to remove all the GUI elemets deleting the onGUI() method but with no result, the canvas buttons cannot be clicked.
I don't know what it is but there must be something that it is "above" the canvas that prevents the clicks even when the webView is not visible.

By the way, I have just read your response to this issue and seems like a good workaround, but how do I know where I have to tap to get back the focus to the canvas? I have tried to put the buttons outside the webview (playing with webview margins) but still nothing.

Thanks :)

KojiNakamaru added a commit that referenced this issue Apr 24, 2019
@KojiNakamaru
Copy link
Member

I've modified the sample app so that

@SoleR7
Copy link
Author

SoleR7 commented Apr 24, 2019

Your modification works, thats what I wanted! Still a pity that I can not place UI elements above the webview so, I will have to change my original desing but that's not a big deal.
In addition to that I have discovered why It didnt work for me previously, I deleted the EventSystem object because I though it wasnt important but without it the clicks are not possible.

Thanks for everything! :)

@abphaiboon
Copy link

Hi @KojiNakamaru sorry for the bump. But is there any way i can place elements on top of the webview? Currently designing around it, like creating a frame or border to hold the webview and my UI elements outside?

But if i can place it on top, that would be amazing. Any workarounds to do this?

@KojiNakamaru
Copy link
Member

Unfortunately, no, as this plugin overlays native webview views over unity's rendering view. There is an experimental implementation that works with "render over ui" #584 but it cannot allow any user interaction with webview views. You can find other implementations on Asset Store #612 (comment) .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants