GetWindowSize() private method

Get the size of the game window in pixels.
private GetWindowSize ( ) : Vector2
return Vector2
    private void ChangeDisplayModeToFullScreen()
    {
        UIPanel uipanel    = GUIMain.GetUIPanel();
        Vector2 windowSize = uipanel.GetWindowSize();

        if (this.fullScreenHeaderPos == Vector3.zero)
        {
            this.fullScreenHeaderPos   = (this.listScreenHeaderPos = this.headerObj.transform.localPosition);
            this.fullScreenHeaderPos.y = windowSize.y;
        }
        if (this.fullScreenUiPos == Vector3.zero)
        {
            this.fullScreenUiPos   = (this.listScreenUiPos = this.scrollPanel.transform.localPosition);
            this.fullScreenUiPos.x = windowSize.x;
        }
        if (this.fullScreenListButtonPos == Vector3.zero)
        {
            this.fullScreenListButtonPos   = (this.listScreenListButtonPos = this.listButton.transform.localPosition);
            this.fullScreenListButtonPos.x = windowSize.x;
        }
        this.MoveTo(this.headerObj, this.fullScreenHeaderPos, this.uiAnimationTime, iTween.EaseType.linear, null);
        this.MoveTo(this.scrollPanel, this.fullScreenUiPos, this.uiAnimationTime, iTween.EaseType.linear, null);
        this.MoveTo(this.listButton, this.fullScreenListButtonPos, this.uiAnimationTime, iTween.EaseType.linear, null);
        this.displayModeButtonLabel.text = StringMaster.GetString("SystemButtonReturn");
        this.displayMode = CMD_DigiGarden.DISPLAY_MODE.FullScreenMode;
    }
Beispiel #2
0
        private void SetGashaCutScene(GameWebAPI.RespDataGA_ExecTicket gashaResult, int playCount)
        {
            string  bgmFileName = (playCount != 1) ? "bgm_205" : "bgm_204";
            UIPanel uipanel     = GUIMain.GetUIPanel();
            CutsceneDataTicketGasha cutsceneDataTicketGasha = new CutsceneDataTicketGasha
            {
                path           = "Cutscenes/ticketGacha",
                gashaResult    = gashaResult.userDungeonTicketList,
                bgmFileName    = bgmFileName,
                backgroundSize = uipanel.GetWindowSize()
            };

            cutsceneDataTicketGasha.endCallback = delegate(RenderTexture renderTexture)
            {
                UITexture txBG = CMD_TicketGashaResult.instance.txBG;
                txBG.mainTexture = renderTexture;
                txBG.width       = renderTexture.width;
                txBG.height      = renderTexture.height;
                CutSceneMain.FadeReqCutSceneEnd();
                SoundMng.Instance().PlayGameBGM("bgm_202");
            };
            Loading.Invisible();
            CutsceneDataBase cutsceneData = cutsceneDataTicketGasha;

            if (ExecGashaTicket.< > f__mg$cache0 == null)
            {
                ExecGashaTicket.< > f__mg$cache0 = new Action(CMD_TicketGashaResult.CreateDialog);
            }
            CutSceneMain.FadeReqCutScene(cutsceneData, ExecGashaTicket.< > f__mg$cache0, null, new Action <int>(this.OnShowedGashaResultDialog), 0.5f, 0.5f);
        }
 protected override bool SetLeftAnchor(UIWidget widget, UIPanel uiPanel)
 {
     if (this.stretchLeft.fit)
     {
         widget.width = Mathf.CeilToInt(uiPanel.GetWindowSize().x * 0.5f + 0.5f);
     }
     return(true);
 }
Beispiel #4
0
 static public int GetWindowSize(IntPtr l)
 {
     try {
         UIPanel self = (UIPanel)checkSelf(l);
         var     ret  = self.GetWindowSize();
         pushValue(l, true);
         pushValue(l, ret);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
    protected override void WindowOpened()
    {
        base.WindowOpened();
        FarmCameraControlForCMD.Off();
        UIPanel uipanel    = GUIMain.GetUIPanel();
        Vector2 windowSize = uipanel.GetWindowSize();

        this.vOrgSCR_HEADER   = this.goSCR_HEADER.transform.localPosition;
        this.vOrgSCR_DETAIL   = this.goSCR_DETAIL.transform.localPosition;
        this.vPosSCR_HEADER   = this.vOrgSCR_HEADER;
        this.vPosSCR_HEADER.y = windowSize.y;
        this.vPosSCR_DETAIL   = this.vOrgSCR_DETAIL;
        this.vPosSCR_DETAIL.x = windowSize.x;
    }
	static int GetWindowSize(IntPtr L)
	{
		try
		{
			ToLua.CheckArgsCount(L, 1);
			UIPanel obj = (UIPanel)ToLua.CheckObject<UIPanel>(L, 1);
			UnityEngine.Vector2 o = obj.GetWindowSize();
			ToLua.Push(L, o);
			return 1;
		}
		catch (Exception e)
		{
			return LuaDLL.toluaL_exception(L, e);
		}
	}
Beispiel #7
0
    private void Start()
    {
        this.projectionTexture = base.GetComponent <UITexture>();
        GameObject original   = AssetDataMng.Instance().LoadObject("UICommon/Render2D/FadeCircleROOT", null, true) as GameObject;
        GameObject gameObject = UnityEngine.Object.Instantiate <GameObject>(original);

        Resources.UnloadUnusedAssets();
        gameObject.transform.localScale    = Vector3.one;
        gameObject.transform.localPosition = Vector3.zero;
        this.fadeCircle = gameObject.GetComponent <FadeCircle>();
        UIPanel uipanel = GUIMain.GetUIPanel();

        this.fadeCircle.Initialize(uipanel.GetWindowSize());
        this.fadeCircle.StartAnimation();
        this.SetSirenEffectTexture(this.fadeCircle);
    }
Beispiel #8
0
        public static UITexture CreateOverlay(Texture2D texture)
        {
            UIRoot  root  = UIRoot.list[0];
            UIPanel panel = NGUITools.AddChild <UIPanel>(root.gameObject);

            UITexture result = NGUITools.AddChild <UITexture>(panel.gameObject);

            result.mainTexture = texture;

            Vector2 windowSize = panel.GetWindowSize();

            result.width  = (int)windowSize.x;
            result.height = (int)windowSize.y;

            return(result);
        }
        protected virtual bool SetTopAnchor(UIWidget widget, UIPanel uiPanel)
        {
            bool result = false;

            if (this.stretchTop.fit)
            {
                if (this.stretchTop.useUIRootWidget)
                {
                    widget.topAnchor.target = uiPanel.transform;
                    widget.topAnchor.Set(1f, 0f);
                }
                else
                {
                    widget.height = Mathf.CeilToInt(uiPanel.GetWindowSize().y);
                }
                result = true;
            }
            return(result);
        }
        protected virtual bool SetLeftAnchor(UIWidget widget, UIPanel uiPanel)
        {
            bool result = false;

            if (this.stretchLeft.fit)
            {
                if (this.stretchLeft.useUIRootWidget)
                {
                    widget.leftAnchor.target = uiPanel.transform;
                    widget.leftAnchor.Set(0f, 0f);
                }
                else
                {
                    widget.width = Mathf.CeilToInt(uiPanel.GetWindowSize().x);
                }
                result = true;
            }
            return(result);
        }
    private void InitOpenScreen()
    {
        this.vOrgSCR_HEADER = this.goSCR_HEADER.transform.localPosition;
        this.vOrgSCR_DETAIL = this.goSCR_DETAIL.transform.localPosition;
        UIPanel    uipanel          = GUIMain.GetUIPanel();
        Vector2    windowSize       = uipanel.GetWindowSize();
        GameObject protectionButton = this.leftUI.GetProtectionButton();

        if (protectionButton.activeSelf)
        {
            this.vOrgSCR_LOCKBTN   = protectionButton.transform.localPosition;
            this.vPosSCR_LOCKBTN   = this.vOrgSCR_LOCKBTN;
            this.vPosSCR_LOCKBTN.x = -windowSize.x;
        }
        this.vPosSCR_HEADER   = this.vOrgSCR_HEADER;
        this.vPosSCR_HEADER.y = windowSize.y;
        this.vPosSCR_DETAIL   = this.vOrgSCR_DETAIL;
        this.vPosSCR_DETAIL.x = windowSize.x;
    }
Beispiel #12
0
 protected override bool SetBottomAnchor(UIWidget widget, UIPanel uiPanel)
 {
     widget.height = Mathf.CeilToInt(uiPanel.GetWindowSize().x * 0.5f + 0.5f);
     return(true);
 }
 protected override bool SetLeftAnchor(UIWidget widget, UIPanel uiPanel)
 {
     widget.width = Mathf.CeilToInt(uiPanel.GetWindowSize().x);
     return(true);
 }