Пример #1
0
        private bool propScreen()
        {
            Vector2 screenSize = new Vector2(Screen.width, Screen.height);

            if (lastScreenSize != screenSize)
            {
                rect           = PV.PropScreenMH(rect.x, rect.y, sizeRatio.width, sizeRatio.height, lastScreenSize);
                lastScreenSize = screenSize;
                calcRectSize();
                return(true);
            }
            return(false);
        }
Пример #2
0
        public Window(string name, Rect ratio, string header, string title, List <Element> children) : base(name, PV.PropScreenMH(ratio))
        {
            this.sizeRatio   = ratio;
            this.HeaderText  = header;
            this.TitleText   = title;
            this.TitleHeight = PV.Line("C1");

            if (children != null && children.Count > 0)
            {
                this.children = new List <Element>(children);
                foreach (Element child in children)
                {
                    child.Parent        = this;
                    child.NotifyParent += this.onChildChenged;
                }
                Resize();
            }

            lastScreenSize = new Vector2(Screen.width, Screen.height);
        }