Пример #1
0
        public override void OnRescaleRequested()
        {
            // Update size
            //--------------
            menuLayout_ = RepositionToolButtons();
            this.width  = ScaledSize.GetWidth(menuLayout_.MaxCols);
            this.height = ScaledSize.GetHeight(menuLayout_.Rows);

            // Update drag size
            //-------------------
            this.Drag.width  = this.width;
            this.Drag.height = ScaledSize.GetTitlebarHeight();
        }
Пример #2
0
        public void UpdatePosition(Vector2 pos)
        {
            Rect rect = new Rect(
                pos.x,
                pos.y,
                ModUI.Instance.MainMenu.width,
                ScaledSize.GetHeight());
            Vector2 resolution = UIView.GetAView().GetScreenResolution();

            VectorUtil.ClampRectToScreen(ref rect, resolution);
            Log.Info($"Setting main menu position to [{pos.x},{pos.y}]");
            absolutePosition = rect.position;
            Invalidate();
        }