Пример #1
0
        /// <inheritdoc/>
        protected override void InitializeServices(EditorGameServiceRegistry services)
        {
            base.InitializeServices(services);

            services.Add(new UIEditorGameCameraService(this));
            services.Add(AdornerService = new UIEditorGameAdornerService(this));
        }
Пример #2
0
 public HighlightAdorner(UIEditorGameAdornerService service, UIElement gameSideElement)
     : base(service, gameSideElement)
 {
     BackgroundColor       = Color.Transparent;
     Visual.Name           = "[Hightlight]";
     Visual.CanBeHitByUser = true;
     // Hidden by default
     Visual.Opacity = 0.0f;
 }
Пример #3
0
        protected BorderAdorner(UIEditorGameAdornerService service, UIElement gameSideElement)
            : base(service, gameSideElement)
        {
            Visual = new Border
            {
                HorizontalAlignment = HorizontalAlignment.Left,
                VerticalAlignment   = VerticalAlignment.Top,
            };

            InitializeAttachedProperties();
        }
Пример #4
0
        public SizingAdorner(UIEditorGameAdornerService service, UIElement gameSideElement, ResizingDirection resizingDirection)
            : base(service, gameSideElement)
        {
            BackgroundColor       = Color.Transparent;
            Visual.Name           = $"[Sizing] {resizingDirection}";
            Visual.CanBeHitByUser = true;

            ResizingDirection = resizingDirection;

            // support for mouse over cursor
            Visual.MouseOverStateChanged += MouseOverStateChanged;
        }
Пример #5
0
        public MarginAdorner(UIEditorGameAdornerService service, UIElement gameSideElement, MarginEdge marginEdge, Graphics.SpriteFont font)
            : base(service, gameSideElement)
        {
            Visual = new Canvas
            {
                CanBeHitByUser = false,
                Name           = $"[Margin] {marginEdge}",
            };
            border    = new Border();
            textBlock = new TextBlock
            {
                BackgroundColor     = Color.WhiteSmoke * 0.5f,
                Font                = font,
                DepthAlignment      = DepthAlignment.Center,
                HorizontalAlignment = HorizontalAlignment.Center,
                VerticalAlignment   = VerticalAlignment.Center,
            };
            Visual.Children.Add(border);
            Visual.Children.Add(textBlock);

            MarginEdge = marginEdge;

            InitializeAttachedProperties();
        }
Пример #6
0
 /// <summary>
 /// Creates a new instance of <see cref="AdornerBase{TVisual}"/>.
 /// </summary>
 /// <param name="service">The adorner service.</param>
 /// <param name="gameSideElement">The associated game-side UIElement.</param>
 protected AdornerBase(UIEditorGameAdornerService service, UIElement gameSideElement)
 {
     Service         = service;
     GameSideElement = gameSideElement;
 }
Пример #7
0
 public MoveAdorner(UIEditorGameAdornerService service, UIElement gameSideElement)
     : base(service, gameSideElement)
 {
     Visual.Name           = "[Move]";
     Visual.CanBeHitByUser = true;
 }