Welcome! › Forums › Unity Plugins › In-App Web Browser › Setting window insets ??
- This topic has 8 replies, 2 voices, and was last updated 5 years, 5 months ago by Piotr.
-
AuthorPosts
-
June 17, 2019 at 10:38 am #1576MavenZipParticipant
Can you please show me a complete example of Setting Window Insets.
I tried this and it did not work.
—
int paddingTop = 50;
int paddingBottom = 50;
int paddingLeft = 32;
int paddingRight = 32;
InAppBrowser.EdgeInsets insets = new InAppBrowser.EdgeInsets(paddingTop, paddingBottom, paddingLeft, paddingRight); options.insets = insets;/* */
InAppBrowser.OpenURL(
“https://www.hopemaven.com/privacy-terms”,options);}
}June 17, 2019 at 10:45 am #1577MavenZipParticipantActually, I want to use Setting Windows Insets AND displayOptions.backButtonText
Please show example of using both.
Thank you.June 17, 2019 at 1:59 pm #1578PiotrKeymasterWhen you say “did not work” – what do you mean? You see different insets? You see no insets? Yo don’t see browser at all? What platform are you using?
June 17, 2019 at 2:30 pm #1584MavenZipParticipantUnity 2018.4.0f1 Personal
Assets\JuiceFresh\Scripts\DonateIDF.cs(24,63): error CS0103: The name ‘options’ does not exist in the current context
June 17, 2019 at 10:30 pm #1585PiotrKeymasterIt seems you have not declared options variable.
June 18, 2019 at 5:33 am #1586MavenZipParticipantPiotr,
I am just a beginner and am not a programmer so I need exact example, please.I want to do two things:
Setting Windows Insets AND displayOptions.backButtonText
I am looking at your PDF instructions for In_app Web Browser, but I need full example, please, including declaring variables for DisplayOptions and Setting Window Insets.
Thanks,
PaulJune 18, 2019 at 12:25 pm #1590PiotrKeymasterJust add this line:
InAppBrowser.DisplayOptions options = new InAppBrowser.DisplayOptions();
Above
options.insets = insets;
June 18, 2019 at 6:03 pm #1591MavenZipParticipantI added coding per your instructions and get errors. I have included the errors, plus the file with they code.
Here are errors:
Assets\JuiceFresh\Scripts\PrivacyPolicy.cs(15,1): error CS0118: ‘InAppBrowser.DisplayOptions’ is a type but is used like a variableAssets\JuiceFresh\Scripts\PrivacyPolicy.cs(21,117): error CS0103: The name ‘options’ does not exist in the current context
Here is the file with code:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;public class
PrivacyPolicy : MonoBehaviour {
public void PolicyButton()
{/* */
/* 14 June 2019 P Nisenbaum – using In-App Web Browser to open URL in game */
/* https://www.kokosoft.pl/in-app-web-browser */
/* */
/* InAppBrowser EdgeInsets adding extra space between browser and game screen */
InAppBrowser.DisplayOptions = new
InAppBrowser.DisplayOptions();
int paddingTop = 50;
int paddingBottom = 50;
int paddingLeft = 32;
int paddingRight = 32;
InAppBrowser.EdgeInsets insets = new InAppBrowser.EdgeInsets(paddingTop, paddingBottom,paddingLeft, paddingRight); options.insets = insets;
/* */
/* replace default Application.OpenURL with InAppBrowser.OpenURL */
/* Application.OpenURL( */
InAppBrowser.OpenURL(
“https://www.hopemaven.com/privacy-terms”,options);}
}June 18, 2019 at 8:28 pm #1592PiotrKeymasterYou have not used snippet I sent you.
-
AuthorPosts
- You must be logged in to reply to this topic.