Esempio n. 1
0
        public Window(int width, int height, NinePatch chrome)
        {
            Blocker             = new TouchArea(0, 0, PixelScene.uiCamera.CameraWidth, PixelScene.uiCamera.CameraHeight);
            Blocker.ClickAction = BlockerClickAction;
            Blocker.Camera      = PixelScene.uiCamera;
            Add(Blocker);

            Chrome = chrome;

            Width  = width;
            Height = height;

            chrome.X = -chrome.MarginLeft();
            chrome.Y = -chrome.MarginTop();
            chrome.Size(width - chrome.X + chrome.MarginRight(), height - chrome.Y + chrome.MarginBottom());
            Add(chrome);

            Camera   = new Camera(0, 0, (int)chrome.Width, (int)chrome.Height, PixelScene.defaultZoom);
            Camera.X = (int)(Game.Width - Camera.CameraWidth * Camera.Zoom) / 2;
            Camera.Y = (int)(Game.Height - Camera.CameraHeight * Camera.Zoom) / 2;
            Camera.Scroll.Set(chrome.X, chrome.Y);
            Camera.Add(Camera);

            Keys.Event.Add(this);
        }
Esempio n. 2
0
        protected override void Layout()
        {
            base.Layout();

            Bg.X = X;
            Bg.Y = Y;
            Bg.Size(Width, Height);
        }
Esempio n. 3
0
            protected override void Layout()
            {
                base.Layout();

                Bg.X = X;
                Bg.Y = Y;

                Bg.Size(Width, Height);

                Slot.SetRect(X + 2, Y + 2, Width - 4, Height - 4);
            }
Esempio n. 4
0
        protected override void Layout()
        {
            base.Layout();

            Bg.X = X;
            Bg.Y = Y;
            Bg.Size(Width, Height);

            Close.SetPos(Bg.X + Bg.Width - Bg.MarginHor() / 2 - MarginHor - Close.Width, Y + (Height - Close.Height) / 2);

            BitmapText.X = Close.Left() - MarginHor - BitmapText.Width;
            BitmapText.Y = Y + (Height - BitmapText.Height) / 2;
            PixelScene.Align(BitmapText);
        }
Esempio n. 5
0
            protected override void Layout()
            {
                base.Layout();

                if (Bg == null)
                {
                    return;
                }

                Bg.X = X;
                Bg.Y = Y;

                Bg.Size(Width, Height);
            }
Esempio n. 6
0
        protected override void Layout()
        {
            base.Layout();

            Bg.X = X;
            Bg.Y = Y;
            Bg.Size(Width, Height);

            InternalText.X = X + (int)(Width - InternalText.Width) / 2;
            InternalText.Y = Y + (int)(Height - InternalText.BaseLine()) / 2;

            if (InternalIcon == null)
            {
                return;
            }

            InternalIcon.X = X + InternalText.X - InternalIcon.Width - 2;
            InternalIcon.Y = Y + (Height - InternalIcon.Height) / 2;
        }