Handles the logical updating of UI elements
Inheritance: TomShane.Neoforce.Controls.Window
Exemplo n.º 1
0
        public ScreenManager(MainWindow window)
        {
            Window = window;
            Manager = window.Manager;

            //Setup a solid black image to use for fading
            fadeTexture = new Texture2D(Manager.GraphicsDevice, 1, 1);
            fadeTexture.SetData<Color>(new Color[1] { Color.Black });

            fadeImage = new ImageBox(Manager) { Passive = true, Left = 0, Top = 0, Width = Window.Width, Height = Window.Height, StayOnTop = true, Image = fadeTexture, SizeMode = SizeMode.Stretched };
            fadeImage.Init();
            fadeImage.Image = fadeTexture;
            fadeImage.Alpha = 0;
            fadeImage.Color = Color.White * fadeImage.Alpha;
            window.Add(fadeImage);
            fadeImage.BringToFront();
            //window.Resize += new ResizeEventHandler(delegate(object o, ResizeEventArgs e)
            //{ fadeImage.SetSize(e.Width, e.Height); /* Update fade image size */ });
        }
Exemplo n.º 2
0
 /// <summary>
 /// Creates a new instance of the main UI window
 /// </summary>
 protected override Window CreateMainWindow()
 {
     TextureLoader = new TextureLoader(Manager.GraphicsDevice, Content);
     IO.CheckFiles();
     IO.LoadSettings(this);
     IO.LoadContentPacks(this); //Load textures from content pack
     MainWindow = new Interface.MainWindow(Manager);
     MainWindow.FocusGained += MainWindow_FocusGained;
     return MainWindow;
 }