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(); }
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); }
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(); }
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(); }
public WarpMenu() : base("WarpMenu", null, false, null, null, false) { Menu = SetUpMenu(); BaseMenu.Add(Menu); }