/// <inheritdoc/> protected override void InitializeServices(EditorGameServiceRegistry services) { base.InitializeServices(services); services.Add(new UIEditorGameCameraService(this)); services.Add(AdornerService = new UIEditorGameAdornerService(this)); }
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; }
protected BorderAdorner(UIEditorGameAdornerService service, UIElement gameSideElement) : base(service, gameSideElement) { Visual = new Border { HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Top, }; InitializeAttachedProperties(); }
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; }
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(); }
/// <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; }
public MoveAdorner(UIEditorGameAdornerService service, UIElement gameSideElement) : base(service, gameSideElement) { Visual.Name = "[Move]"; Visual.CanBeHitByUser = true; }