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

How to resize webview object to prevent fullscreen view? #810

Open
ghost opened this issue Jun 3, 2022 · 6 comments
Open

How to resize webview object to prevent fullscreen view? #810

ghost opened this issue Jun 3, 2022 · 6 comments

Comments

@ghost
Copy link

ghost commented Jun 3, 2022

No description provided.

@KojiNakamaru
Copy link
Member

You can utilize SetMargins() as in the sample app:

webViewObject.SetMargins(5, 100, 5, Screen.height / 4);

@ghost
Copy link
Author

ghost commented Jun 6, 2022

I try to show what I understand from your extention. Firstly I try to show something inside SampleWebView script.

margin-set-1

margin-set-2

I want to ask some questions. How to use these formulas when the position of window change?

If the position of panel is center of screen there is no problem, but if I change the position for example left corner with some margins do I have to provide another formulas or solutions to do that?

Is there a function or a way which provided from you? For example, let say there is function. First parameter is position on screen, second parameter is size on screen like SetWindow(Vector2 pos, Vector2 size)

@KojiNakamaru
Copy link
Member

You can align a WebView to a RectTransform as described in #567 (comment) . Also, SetMargins() internally cache margins and don't perform an actual update if margins don't change, so you can call it in every Update() to keep the WebView aligned.

@ghost
Copy link
Author

ghost commented Jun 6, 2022

Tomorrow, I will check it. Thanks.

@ghost
Copy link
Author

ghost commented Jun 15, 2022

I tried but result was unexpected.

@KojiNakamaru
Copy link
Member

I made an example below:

#816

which realizes the logic described in #810 (comment) . Please check this example.

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

1 participant