Setting window insets ??

Welcome! Forums Unity Plugins In-App Web Browser Setting window insets ??

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #1576
    MavenZip
    Participant

    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);

    }
    }

    #1577
    MavenZip
    Participant

    Actually, I want to use Setting Windows Insets AND displayOptions.backButtonText

    Please show example of using both.
    Thank you.

    #1578
    PiotrPiotr
    Keymaster

    When 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?

    #1584
    MavenZip
    Participant

    Unity 2018.4.0f1 Personal

    Assets\JuiceFresh\Scripts\DonateIDF.cs(24,63): error CS0103: The name ‘options’ does not exist in the current context

    #1585
    PiotrPiotr
    Keymaster

    It seems you have not declared options variable.

    #1586
    MavenZip
    Participant

    Piotr,
    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,
    Paul

    #1590
    PiotrPiotr
    Keymaster

    Just add this line:
    InAppBrowser.DisplayOptions options = new InAppBrowser.DisplayOptions();

    Above options.insets = insets;

    #1591
    MavenZip
    Participant

    I 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 variable

    Assets\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);

    }
    }

    #1592
    PiotrPiotr
    Keymaster

    You have not used snippet I sent you.

Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.