Пример #1
0
 public Window(WndFile wndFile, Game game, WndCallbackResolver wndCallbackResolver)
     : this(wndFile.RootWindow.ScreenRect.CreationResolution, CreateRootControl(wndFile, game.ContentManager, game.AssetStore, wndCallbackResolver), game.ContentManager)
 {
     Game           = game;
     Bounds         = wndFile.RootWindow.ScreenRect.ToRectangle();
     LayoutInit     = wndCallbackResolver.GetWindowCallback(wndFile.LayoutBlock.LayoutInit);
     LayoutUpdate   = wndCallbackResolver.GetWindowCallback(wndFile.LayoutBlock.LayoutUpdate);
     LayoutShutdown = wndCallbackResolver.GetWindowCallback(wndFile.LayoutBlock.LayoutShutdown);
 }
Пример #2
0
        protected override Window LoadEntry(FileSystemEntry entry, ContentManager contentManager, Game game, LoadOptions loadOptions)
        {
            var wndFile = WndFile.FromFileSystemEntry(entry);

            var rootControl = CreateElementRecursive(
                wndFile.RootWindow,
                contentManager,
                _wndCallbackResolver,
                wndFile.RootWindow.ScreenRect.ToRectangle().Location);

            return(new Window(wndFile.RootWindow.ScreenRect.CreationResolution, rootControl, contentManager)
            {
                LayoutInit = _wndCallbackResolver.GetWindowCallback(wndFile.LayoutBlock.LayoutInit),
                LayoutUpdate = _wndCallbackResolver.GetWindowCallback(wndFile.LayoutBlock.LayoutUpdate),
                LayoutShutdown = _wndCallbackResolver.GetWindowCallback(wndFile.LayoutBlock.LayoutShutdown)
            });
        }
Пример #3
0
        public Window(WndFile wndFile, Game game, WndCallbackResolver wndCallbackResolver)
            : this(wndFile.RootWindow.ScreenRect.CreationResolution, game.GraphicsLoadContext)
        {
            Game           = game;
            Bounds         = wndFile.RootWindow.ScreenRect.ToRectangle();
            LayoutInit     = wndCallbackResolver.GetWindowCallback(wndFile.LayoutBlock.LayoutInit);
            LayoutUpdate   = wndCallbackResolver.GetWindowCallback(wndFile.LayoutBlock.LayoutUpdate);
            LayoutShutdown = wndCallbackResolver.GetWindowCallback(wndFile.LayoutBlock.LayoutShutdown);

            Root = CreateRecursive(
                wndFile.RootWindow,
                ImageLoader,
                game.ContentManager,
                game.AssetStore,
                wndCallbackResolver,
                wndFile.RootWindow.ScreenRect.UpperLeft);
            Controls.Add(Root);
        }