コード例 #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="UIEditorController"/> class.
        /// </summary>
        /// <param name="asset">The asset associated with this instance.</param>
        /// <param name="editor">The editor associated with this instance.</param>
        protected UIEditorController([NotNull] AssetViewModel asset, [NotNull] UIEditorBaseViewModel editor)
            : base(asset, editor, CreateEditorGame)
        {
            // move this in a service shared by all editor controllers
            defaultFontLazy = new Lazy <Graphics.SpriteFont>(() =>
            {
                var fontItem           = SignedDistanceFieldSpriteFontFactory.Create();
                fontItem.FontType.Size = 16.0f;
                return(SignedDistanceFieldFontCompiler.Compile(Game.Services.GetService <IFontFactory>(), fontItem));
            });

            var resolutionNode = Editor.NodeContainer.GetNode(((UIAssetBase)Asset.Asset).Design)[nameof(UIAssetBase.UIDesign.Resolution)];

            resolutionNode.ValueChanged += ResolutionChanged;
            resolution = (Vector3)resolutionNode.Retrieve();
        }
コード例 #2
0
 public UIPageRootViewModel([NotNull] UIEditorBaseViewModel editor, [NotNull] UIPageViewModel asset, UIElementDesign rootElement)
     : base(editor, asset, rootElement?.Yield())
 {
     NotifyGameSidePartAdded().Forget();
 }
コード例 #3
0
 public UILibraryRootViewModel(UIEditorBaseViewModel editor, [NotNull] UILibraryViewModel asset, IEnumerable <UIElementDesign> rootElements)
     : base(editor, asset, rootElements)
 {
     NotifyGameSidePartAdded().Forget();
 }