public PlatoUIMenu(string id, UIElement element, bool clone = false, Texture2D background = null, Color?backgroundColor = null, bool movingBackground = false)
            : base(0, 0, Game1.viewport.Width, Game1.viewport.Height, false)
        {
#if ANDROID
#else
            lastUIZoom = Game1.options.desiredUIScale;
            Game1.options.desiredUIScale = Game1.options.desiredBaseZoomLevel;
            PyTK.PyTKMod._helper.Events.GameLoop.UpdateTicked += GameLoop_UpdateTicked;;
#endif

            if (backgroundColor.HasValue)
            {
                BackgroundColor = backgroundColor.Value;
            }
            BackgroundIsMoving = movingBackground;
            Background         = background;
            Id       = id;
            BaseMenu = UIElement.GetContainer("CurrentMenu");
            if (element != null)
            {
                BaseMenu.Add(clone ? element.Clone().WithBase(BaseMenu) : element.WithBase(BaseMenu));
            }

            BaseMenu.UpdateBounds();
        }
예제 #2
0
 public WarpMenu()
     : base("WarpMenu", null, false, null, null, false)
 {
     menuScale = 1f;
     menuScale = Math.Max(1f, Game1.game1.Window.ClientBounds.Width / (menuWidth + 40f));
     menuScale = Math.Min(Game1.game1.Window.ClientBounds.Height / ((menuHeight / menuScale) + 40f), menuScale);
     Console.WriteLine(menuScale + " menuScale");
     menuScale /= Game1.options.zoomLevel;
     Menu       = SetUpMenu();
     BaseMenu.Add(Menu);
 }
예제 #3
0
        public PlatoUIMenu(string id, UIElement element, bool clone = false, Texture2D background = null, Color?backgroundColor = null, bool movingBackground = false)
            : base(0, 0, Game1.viewport.Width, Game1.viewport.Height, false)
        {
            if (backgroundColor.HasValue)
            {
                BackgroundColor = backgroundColor.Value;
            }
            BackgroundIsMoving = movingBackground;
            Background         = background;
            Id       = id;
            BaseMenu = UIElement.GetContainer("CurrentMenu");
            if (element != null)
            {
                BaseMenu.Add(clone ? element.Clone().WithBase(BaseMenu) : element.WithBase(BaseMenu));
            }

            BaseMenu.UpdateBounds();
        }
예제 #4
0
        public PlatoUIGame(string id, UIElement element, bool drawMouse = true, bool quitOnESC = true, bool clone = false, Texture2D background = null, Color?backgroundColor = null, bool movingBackground = false)
        {
            Id        = id;
            DrawMouse = drawMouse;
            QuitOnESC = quitOnESC;
            if (backgroundColor.HasValue)
            {
                BackgroundColor = backgroundColor.Value;
            }
            BackgroundIsMoving = movingBackground;
            Background         = background;
            Id       = id;
            BaseMenu = UIElement.GetContainer("CurrentMinigame");
            if (element != null)
            {
                BaseMenu.Add(clone ? element.Clone().WithBase(BaseMenu) : element.WithBase(BaseMenu));
            }

            UIElement.Viewportbase.UpdateBounds();
            BaseMenu.UpdateBounds();
        }
예제 #5
0
 public WarpMenu()
     : base("WarpMenu", null, false, null, null, false)
 {
     Menu = SetUpMenu();
     BaseMenu.Add(Menu);
 }