public AGSCharacter(string id, Resolver resolver, IOutfit outfit) : base(id, resolver) { _hasRoom = AddComponent <IHasRoom>(); _animationContainer = AddComponent <IAnimationContainer>(); _inObjectTree = AddComponent <IInObjectTree>(); _collider = AddComponent <ICollider>(); _visibleComponent = AddComponent <IVisibleComponent>(); _enabledComponent = AddComponent <IEnabledComponent>(); _customProperties = AddComponent <ICustomPropertiesComponent>(); _drawableInfo = AddComponent <IDrawableInfo>(); _hotspotComponent = AddComponent <IHotspotComponent>(); _shaderComponent = AddComponent <IShaderComponent>(); _translateComponent = AddComponent <ITranslateComponent>(); _imageComponent = AddComponent <IImageComponent>(); _scaleComponent = AddComponent <IScaleComponent>(); _rotateComponent = AddComponent <IRotateComponent>(); _pixelPerfectComponent = AddComponent <IPixelPerfectComponent>(); _faceDirectionBehavior = AddComponent <IFaceDirectionBehavior>(); _hasOutfit = AddComponent <IHasOutfit>(); _hasInventory = AddComponent <IHasInventory>(); _followBehavior = AddComponent <IFollowBehavior>(); _modelMatrixComponent = AddComponent <IModelMatrixComponent>(); beforeInitComponents(resolver, outfit); InitComponents(); afterInitComponents(resolver, outfit); }
public AGSCheckBox(string id, Resolver resolver) : base(id, resolver) { _uIEvents = AddComponent<IUIEvents>(); _skinComponent = AddComponent<ISkinComponent>(); _hasRoom = AddComponent<IHasRoom>(); _animationContainer = AddComponent<IAnimationContainer>(); _inObjectTree = AddComponent<IInObjectTree>(); _collider = AddComponent<ICollider>(); _visibleComponent = AddComponent<IVisibleComponent>(); _enabledComponent = AddComponent<IEnabledComponent>(); _customProperties = AddComponent<ICustomPropertiesComponent>(); _drawableInfo = AddComponent<IDrawableInfo>(); _hotspotComponent = AddComponent<IHotspotComponent>(); _shaderComponent = AddComponent<IShaderComponent>(); _translateComponent = AddComponent<ITranslateComponent>(); _imageComponent = AddComponent<IImageComponent>(); _scaleComponent = AddComponent<IScaleComponent>(); _rotateComponent = AddComponent<IRotateComponent>(); _pixelPerfectComponent = AddComponent<IPixelPerfectComponent>(); _textComponent = AddComponent<ITextComponent>(); _checkboxComponent = AddComponent<ICheckboxComponent>(); beforeInitComponents(resolver); InitComponents(); afterInitComponents(resolver); }
public AGSButton(string id, Resolver resolver) : base(id, resolver) { _uIEvents = AddComponent <IUIEvents>(); _skinComponent = AddComponent <ISkinComponent>(); _hasRoom = AddComponent <IHasRoom>(); _animationContainer = AddComponent <IAnimationContainer>(); _inObjectTree = AddComponent <IInObjectTree>(); _collider = AddComponent <ICollider>(); _visibleComponent = AddComponent <IVisibleComponent>(); _enabledComponent = AddComponent <IEnabledComponent>(); _customProperties = AddComponent <ICustomPropertiesComponent>(); _drawableInfo = AddComponent <IDrawableInfo>(); _hotspotComponent = AddComponent <IHotspotComponent>(); _shaderComponent = AddComponent <IShaderComponent>(); _translateComponent = AddComponent <ITranslateComponent>(); _imageComponent = AddComponent <IImageComponent>(); _scaleComponent = AddComponent <IScaleComponent>(); _rotateComponent = AddComponent <IRotateComponent>(); _pixelPerfectComponent = AddComponent <IPixelPerfectComponent>(); _textComponent = AddComponent <ITextComponent>(); _buttonComponent = AddComponent <IButtonComponent>(); _modelMatrixComponent = AddComponent <IModelMatrixComponent>(); beforeInitComponents(resolver); InitComponents(); afterInitComponents(resolver); }
public AGSCharacter(string id, Resolver resolver, IOutfit outfit) : base(id, resolver) { _hasRoom = AddComponent<IHasRoom>(); _animationContainer = AddComponent<IAnimationContainer>(); _inObjectTree = AddComponent<IInObjectTree>(); _collider = AddComponent<ICollider>(); _visibleComponent = AddComponent<IVisibleComponent>(); _enabledComponent = AddComponent<IEnabledComponent>(); _customProperties = AddComponent<ICustomPropertiesComponent>(); _drawableInfo = AddComponent<IDrawableInfo>(); _hotspotComponent = AddComponent<IHotspotComponent>(); _shaderComponent = AddComponent<IShaderComponent>(); _transformComponent = AddComponent<ITranslateComponent>(); _imageComponent = AddComponent<IImageComponent>(); _scaleComponent = AddComponent<IScaleComponent>(); _rotateComponent = AddComponent<IRotateComponent>(); _pixelPerfectComponent = AddComponent<IPixelPerfectComponent>(); _faceDirectionBehavior = AddComponent<IFaceDirectionBehavior>(); _hasOutfit = AddComponent<IHasOutfit>(); _hasInventory = AddComponent<IHasInventory>(); _followBehavior = AddComponent<IFollowBehavior>(); beforeInitComponents(resolver, outfit); InitComponents(); afterInitComponents(resolver, outfit); }
public override void Init(IEntity entity) { base.Init(entity); _entity = entity; entity.Bind <ITextComponent>(c => { _textComponent = c; c.PropertyChanged += onTextPropertyChanged; }, c => { _textComponent = null; c.PropertyChanged -= onTextPropertyChanged; }); entity.Bind <IImageComponent>(c => _imageComponent = c, _ => _imageComponent = null); entity.Bind <IUIEvents>(c => { _uiEvents = c; c.MouseDown.Subscribe(onMouseDown); c.LostFocus.Subscribe(onMouseDownOutside); }, c => { _uiEvents = null; c.MouseDown.Unsubscribe(onMouseDown); c.LostFocus.Unsubscribe(onMouseDownOutside); }); entity.Bind <IInObjectTreeComponent>(c => _tree = c, _ => _tree = null); entity.Bind <IHasRoomComponent>(c => _room = c, _ => _room = null); entity.Bind <IVisibleComponent>(c => _visibleComponent = c, _ => _visibleComponent = null); _game.Events.OnRepeatedlyExecute.Subscribe(onRepeatedlyExecute); _caretFlashCounter = (int)CaretFlashDelay; _withCaret = _game.Factory.UI.GetLabel(entity.ID + " Caret", "|", 1f, 1f, 0f, 0f, config: new AGSTextConfig(autoFit: AutoFit.LabelShouldFitText)); _withCaret.Pivot = new PointF(0f, 0f); _withCaret.TextBackgroundVisible = false; entity.Bind <IAnimationComponent>(c => { c.PropertyChanged += onAnimationPropertyChanged; _animationComponent = c; updateBorder(); }, c => { c.PropertyChanged -= onAnimationPropertyChanged; _animationComponent = null; updateBorder(); }); entity.Bind <IDrawableInfoComponent>(c => { _drawableComponent = c; c.PropertyChanged += onDrawableChanged; onRenderLayerChanged(); }, c => { c.PropertyChanged -= onDrawableChanged; _drawableComponent = null; }); }
public override void Init(IEntity entity) { base.Init(entity); _entity = entity; _enabled = entity.GetComponent<IEnabledComponent>(); _visible = entity.GetComponent<IVisibleComponent>(); _gameEvents.OnRepeatedlyExecute.SubscribeToAsync(onRepeatedlyExecute); }
public override void Init(IEntity entity) { base.Init(entity); _entity = entity; _enabled = entity.GetComponent <IEnabledComponent>(); _visible = entity.GetComponent <IVisibleComponent>(); _gameEvents.OnRepeatedlyExecute.SubscribeToAsync(onRepeatedlyExecute); }
public override void Init(IEntity entity) { base.Init(entity); _collider = entity.GetComponent<ICollider>(); _drawableInfo = entity.GetComponent<IDrawableInfo>(); _tree = entity.GetComponent<IInObjectTree>(); _visible = entity.GetComponent<IVisibleComponent>(); _enabled = entity.GetComponent<IEnabledComponent>(); _gameEvents.OnRepeatedlyExecute.Subscribe(onRepeatedlyExecute); }
public override void Init(IEntity entity) { base.Init(entity); _collider = entity.GetComponent <ICollider>(); _drawableInfo = entity.GetComponent <IDrawableInfo>(); _tree = entity.GetComponent <IInObjectTree>(); _visible = entity.GetComponent <IVisibleComponent>(); _enabled = entity.GetComponent <IEnabledComponent>(); _gameEvents.OnRepeatedlyExecute.Subscribe(onRepeatedlyExecute); }
public override void Init() { base.Init(); bindGraphics(Graphics); Entity.Bind <IDrawableInfoComponent>(c => _drawableInfo = c, _ => _drawableInfo = null); Entity.Bind <IInObjectTreeComponent>(c => _tree = c, _ => _tree = null); Entity.Bind <IVisibleComponent>(c => _visible = c, _ => _visible = null); Entity.Bind <IEnabledComponent>(c => _enabled = c, _ => _enabled = null); Entity.Bind <IUIEvents>(c => c.LostFocus.Subscribe(onLostFocus), c => c.LostFocus.Unsubscribe(onLostFocus)); _gameEvents.OnRepeatedlyExecute.Subscribe(onRepeatedlyExecute); }
public override void Init() { base.Init(); Entity.Bind <IImageComponent>(c => _image = c, _ => _image = null); Entity.Bind <IScaleComponent>(c => { _scale = c; c.PropertyChanged += onScalePropertyChanged; }, c => { _scale = null; c.PropertyChanged -= onScalePropertyChanged; }); Entity.Bind <IDrawableInfoComponent>(c => { _drawable = c; c.PropertyChanged += onDrawablePropertyChanged; }, c => { _drawable = null; c.PropertyChanged -= onDrawablePropertyChanged; }); Entity.Bind <ICropSelfComponent>(c => _cropSelf = c, _ => _cropSelf = null); Entity.Bind <IModelMatrixComponent>(c => { _matrix = c; c.OnMatrixChanged.Subscribe(onMatrixChanged); }, c => { _matrix = null; c.OnMatrixChanged.Unsubscribe(onMatrixChanged); }); Entity.Bind <IVisibleComponent>(c => _visible = c, _ => _visible = null); _events.OnRepeatedlyExecute.Subscribe(onRepeatedlyExecute); _pipeline.Subscribe(Entity.ID, this, -10); }
public AGSCharacter(string id, Resolver resolver, IOutfit outfit) : base(id, resolver) { _hasRoomComponent = AddComponent <IHasRoomComponent>(); Bind <IHasRoomComponent>(c => _hasRoomComponent = c, _ => {}); _animationComponent = AddComponent <IAnimationComponent>(); Bind <IAnimationComponent>(c => _animationComponent = c, _ => {}); _inObjectTreeComponent = AddComponent <IInObjectTreeComponent>(); Bind <IInObjectTreeComponent>(c => _inObjectTreeComponent = c, _ => {}); _colliderComponent = AddComponent <IColliderComponent>(); Bind <IColliderComponent>(c => _colliderComponent = c, _ => {}); _visibleComponent = AddComponent <IVisibleComponent>(); Bind <IVisibleComponent>(c => _visibleComponent = c, _ => {}); _enabledComponent = AddComponent <IEnabledComponent>(); Bind <IEnabledComponent>(c => _enabledComponent = c, _ => {}); _customPropertiesComponent = AddComponent <ICustomPropertiesComponent>(); Bind <ICustomPropertiesComponent>(c => _customPropertiesComponent = c, _ => {}); _drawableInfoComponent = AddComponent <IDrawableInfoComponent>(); Bind <IDrawableInfoComponent>(c => _drawableInfoComponent = c, _ => {}); _shaderComponent = AddComponent <IShaderComponent>(); Bind <IShaderComponent>(c => _shaderComponent = c, _ => {}); _translateComponent = AddComponent <ITranslateComponent>(); Bind <ITranslateComponent>(c => _translateComponent = c, _ => {}); _imageComponent = AddComponent <IImageComponent>(); Bind <IImageComponent>(c => _imageComponent = c, _ => {}); _borderComponent = AddComponent <IBorderComponent>(); Bind <IBorderComponent>(c => _borderComponent = c, _ => { }); _scaleComponent = AddComponent <IScaleComponent>(); Bind <IScaleComponent>(c => _scaleComponent = c, _ => {}); _rotateComponent = AddComponent <IRotateComponent>(); Bind <IRotateComponent>(c => _rotateComponent = c, _ => {}); _pixelPerfectComponent = AddComponent <IPixelPerfectComponent>(); Bind <IPixelPerfectComponent>(c => _pixelPerfectComponent = c, _ => {}); _modelMatrixComponent = AddComponent <IModelMatrixComponent>(); Bind <IModelMatrixComponent>(c => _modelMatrixComponent = c, _ => {}); _boundingBoxComponent = AddComponent <IBoundingBoxComponent>(); Bind <IBoundingBoxComponent>(c => _boundingBoxComponent = c, _ => {}); _worldPositionComponent = AddComponent <IWorldPositionComponent>(); Bind <IWorldPositionComponent>(c => _worldPositionComponent = c, _ => {}); _faceDirectionComponent = AddComponent <IFaceDirectionComponent>(); Bind <IFaceDirectionComponent>(c => _faceDirectionComponent = c, _ => {}); _outfitComponent = AddComponent <IOutfitComponent>(); Bind <IOutfitComponent>(c => _outfitComponent = c, _ => {}); _inventoryComponent = AddComponent <IInventoryComponent>(); Bind <IInventoryComponent>(c => _inventoryComponent = c, _ => {}); _followComponent = AddComponent <IFollowComponent>(); Bind <IFollowComponent>(c => _followComponent = c, _ => {}); _hotspotComponent = AddComponent <IHotspotComponent>(); Bind <IHotspotComponent>(c => _hotspotComponent = c, _ => {}); beforeInitComponents(resolver, outfit); InitComponents(); afterInitComponents(resolver, outfit); }
public Subscriber(IEntity entity, Action <bool> setMouseIn, IUIEvents events, IEnabledComponent enabled, IVisibleComponent visible) { Entity = entity; SetMouseIn = setMouseIn; Events = events; Enabled = enabled; Visible = visible; LeftMouseClickTimer = new Stopwatch(); RightMouseClickTimer = new Stopwatch(); LeftMouseDoubleClickTimer = new Stopwatch(); RightMouseDoubleClickTimer = new Stopwatch(); }
public AGSButton(string id, Resolver resolver) : base(id, resolver) { _uIEvents = AddComponent <IUIEvents>(); Bind <IUIEvents>(c => _uIEvents = c, _ => {}); _skinComponent = AddComponent <ISkinComponent>(); Bind <ISkinComponent>(c => _skinComponent = c, _ => {}); _hasRoomComponent = AddComponent <IHasRoomComponent>(); Bind <IHasRoomComponent>(c => _hasRoomComponent = c, _ => {}); _animationComponent = AddComponent <IAnimationComponent>(); Bind <IAnimationComponent>(c => _animationComponent = c, _ => {}); _inObjectTreeComponent = AddComponent <IInObjectTreeComponent>(); Bind <IInObjectTreeComponent>(c => _inObjectTreeComponent = c, _ => {}); _colliderComponent = AddComponent <IColliderComponent>(); Bind <IColliderComponent>(c => _colliderComponent = c, _ => {}); _visibleComponent = AddComponent <IVisibleComponent>(); Bind <IVisibleComponent>(c => _visibleComponent = c, _ => {}); _enabledComponent = AddComponent <IEnabledComponent>(); Bind <IEnabledComponent>(c => _enabledComponent = c, _ => {}); _customPropertiesComponent = AddComponent <ICustomPropertiesComponent>(); Bind <ICustomPropertiesComponent>(c => _customPropertiesComponent = c, _ => {}); _drawableInfoComponent = AddComponent <IDrawableInfoComponent>(); Bind <IDrawableInfoComponent>(c => _drawableInfoComponent = c, _ => {}); _shaderComponent = AddComponent <IShaderComponent>(); Bind <IShaderComponent>(c => _shaderComponent = c, _ => {}); _translateComponent = AddComponent <ITranslateComponent>(); Bind <ITranslateComponent>(c => _translateComponent = c, _ => {}); _imageComponent = AddComponent <IImageComponent>(); Bind <IImageComponent>(c => _imageComponent = c, _ => {}); _borderComponent = AddComponent <IBorderComponent>(); Bind <IBorderComponent>(c => _borderComponent = c, _ => { }); _scaleComponent = AddComponent <IScaleComponent>(); Bind <IScaleComponent>(c => _scaleComponent = c, _ => {}); _rotateComponent = AddComponent <IRotateComponent>(); Bind <IRotateComponent>(c => _rotateComponent = c, _ => {}); _pixelPerfectComponent = AddComponent <IPixelPerfectComponent>(); Bind <IPixelPerfectComponent>(c => _pixelPerfectComponent = c, _ => {}); _modelMatrixComponent = AddComponent <IModelMatrixComponent>(); Bind <IModelMatrixComponent>(c => _modelMatrixComponent = c, _ => {}); _boundingBoxComponent = AddComponent <IBoundingBoxComponent>(); Bind <IBoundingBoxComponent>(c => _boundingBoxComponent = c, _ => {}); _worldPositionComponent = AddComponent <IWorldPositionComponent>(); Bind <IWorldPositionComponent>(c => _worldPositionComponent = c, _ => {}); _textComponent = AddComponent <ITextComponent>(); Bind <ITextComponent>(c => _textComponent = c, _ => {}); _buttonComponent = AddComponent <IButtonComponent>(); Bind <IButtonComponent>(c => _buttonComponent = c, _ => {}); beforeInitComponents(resolver); InitComponents(); afterInitComponents(resolver); }
private void selectArea(ITreeStringNode node) { var obj = node.Properties.Entities.GetValue(Fields.Entity); _inspector.Show(obj); var area = obj.GetComponent <IAreaComponent>(); var debugMask = area.Mask.DebugDraw; if (debugMask != null) { _lastMaskVisible = debugMask.Visible; _lastSelectedMaskVisible = debugMask; debugMask.Visible = true; } }
public AGSInventoryWindow(string id, Resolver resolver, IImage image) : base(id, resolver) { _uIEvents = AddComponent <IUIEvents>(); Bind <IUIEvents>(c => _uIEvents = c, _ => {}); _skinComponent = AddComponent <ISkinComponent>(); Bind <ISkinComponent>(c => _skinComponent = c, _ => {}); _hasRoom = AddComponent <IHasRoomComponent>(); Bind <IHasRoomComponent>(c => _hasRoom = c, _ => {}); _animationComponent = AddComponent <IAnimationComponent>(); Bind <IAnimationComponent>(c => _animationComponent = c, _ => {}); _inObjectTree = AddComponent <IInObjectTreeComponent>(); Bind <IInObjectTreeComponent>(c => _inObjectTree = c, _ => {}); _collider = AddComponent <IColliderComponent>(); Bind <IColliderComponent>(c => _collider = c, _ => {}); _visibleComponent = AddComponent <IVisibleComponent>(); Bind <IVisibleComponent>(c => _visibleComponent = c, _ => {}); _enabledComponent = AddComponent <IEnabledComponent>(); Bind <IEnabledComponent>(c => _enabledComponent = c, _ => {}); _customPropertiesComponent = AddComponent <ICustomPropertiesComponent>(); Bind <ICustomPropertiesComponent>(c => _customPropertiesComponent = c, _ => {}); _drawableInfo = AddComponent <IDrawableInfoComponent>(); Bind <IDrawableInfoComponent>(c => _drawableInfo = c, _ => {}); _hotspotComponent = AddComponent <IHotspotComponent>(); Bind <IHotspotComponent>(c => _hotspotComponent = c, _ => {}); _shaderComponent = AddComponent <IShaderComponent>(); Bind <IShaderComponent>(c => _shaderComponent = c, _ => {}); _translateComponent = AddComponent <ITranslateComponent>(); Bind <ITranslateComponent>(c => _translateComponent = c, _ => {}); _imageComponent = AddComponent <IImageComponent>(); Bind <IImageComponent>(c => _imageComponent = c, _ => {}); _scaleComponent = AddComponent <IScaleComponent>(); Bind <IScaleComponent>(c => _scaleComponent = c, _ => {}); _rotateComponent = AddComponent <IRotateComponent>(); Bind <IRotateComponent>(c => _rotateComponent = c, _ => {}); _pixelPerfectComponent = AddComponent <IPixelPerfectComponent>(); Bind <IPixelPerfectComponent>(c => _pixelPerfectComponent = c, _ => {}); _modelMatrixComponent = AddComponent <IModelMatrixComponent>(); Bind <IModelMatrixComponent>(c => _modelMatrixComponent = c, _ => {}); _boundingBoxComponent = AddComponent <IBoundingBoxComponent>(); Bind <IBoundingBoxComponent>(c => _boundingBoxComponent = c, _ => {}); _inventoryWindowComponent = AddComponent <IInventoryWindowComponent>(); Bind <IInventoryWindowComponent>(c => _inventoryWindowComponent = c, _ => {}); beforeInitComponents(resolver, image); InitComponents(); afterInitComponents(resolver, image); }
private void selectObject(ITreeStringNode node) { var obj = node.Properties.Entities.GetValue(Fields.Entity); _inspector.Show(obj); _lastSelectedEntity = obj; var host = new AGSComponentHost(_editor.EditorResolver); host.Init(obj, typeof(AGSComponentHost)); TypedParameter uiEventsAggParam = new TypedParameter(typeof(UIEventsAggregator), _editor.UIEventsAggregator); var uiEvents = _editor.EditorResolver.Container.Resolve <EditorUIEvents>(uiEventsAggParam); obj.AddComponent <EditorUIEvents>(uiEvents); host.AddComponent <EntityDesigner>(); var visibleComponent = obj.GetComponent <IVisibleComponent>(); var image = obj.GetComponent <IImageComponent>(); var borderComponent = obj.GetComponent <IBorderComponent>(); var enabledComponent = obj.GetComponent <IEnabledComponent>(); if (enabledComponent != null) { _lastSelectedEnabled = enabledComponent; _lastEnabled = enabledComponent.Enabled; _lastClickThrough = enabledComponent.ClickThrough; enabledComponent.Enabled = true; enabledComponent.ClickThrough = false; } if (image != null) { if (image.Opacity == 0) { _lastOpacity = image.Opacity; _lastSelectedMaskImage = image; image.Opacity = 100; } } if (visibleComponent != null) { _lastMaskVisible = visibleComponent.Visible; _lastSelectedMaskVisible = visibleComponent; visibleComponent.Visible = true; } }
private void selectObject(ITreeStringNode node) { var obj = node.Properties.Entities.GetValue(Fields.Entity); _inspector.Inspector.Show(obj); var visibleComponent = obj.GetComponent <IVisibleComponent>(); var image = obj.GetComponent <IImageComponent>(); var borderComponent = obj.GetComponent <IBorderComponent>(); if (image != null && borderComponent != null) { _lastSelectedBorder = borderComponent; IBorderStyle border = null; border = borderComponent.Border; _lastObjectBorder = border; IBorderStyle hoverBorder = AGSBorders.Gradient(new FourCorners <Color>(Colors.Yellow, Colors.Yellow.WithAlpha(150), Colors.Yellow.WithAlpha(150), Colors.Yellow), 1, true); if (border == null) { borderComponent.Border = hoverBorder; } else { borderComponent.Border = AGSBorders.Multiple(border, hoverBorder); } if (image.Opacity == 0) { _lastOpacity = image.Opacity; _lastSelectedMaskImage = image; image.Opacity = 100; } } if (visibleComponent != null) { _lastMaskVisible = visibleComponent.Visible; _lastSelectedMaskVisible = visibleComponent; visibleComponent.Visible = true; } }
public override void Init() { base.Init(); Entity.Bind <ITextComponent>(c => { _textComponent = c; c.PropertyChanged += onTextPropertyChanged; }, c => { _textComponent = null; c.PropertyChanged -= onTextPropertyChanged; }); Entity.Bind <IUIEvents>(c => { c.MouseDown.Subscribe(onMouseDown); c.LostFocus.Subscribe(onMouseDownOutside); }, c => { c.MouseDown.Unsubscribe(onMouseDown); c.LostFocus.Unsubscribe(onMouseDownOutside); }); Entity.Bind <IInObjectTreeComponent>(c => _tree = c, _ => _tree = null); Entity.Bind <IHasRoomComponent>(c => _room = c, _ => _room = null); Entity.Bind <IVisibleComponent>(c => _visibleComponent = c, _ => _visibleComponent = null); _caretFlashCounter = (int)CaretFlashDelay; _withCaret = new Lazy <ILabel>(() => { var label = _game.Factory.UI.GetLabel(Entity.ID + " Caret", "|", 1f, 1f, 0f, 0f, config: _game.Factory.Fonts.GetTextConfig(autoFit: AutoFit.LabelShouldFitText)); label.Pivot = new PointF(0f, 0f); label.TextBackgroundVisible = false; return(label); }); Entity.Bind <IImageComponent>(c => _imageComponent = c, _ => _imageComponent = null); Entity.Bind <IDrawableInfoComponent>(c => _drawableComponent = c, _ => _drawableComponent = null); _game.Events.OnRepeatedlyExecute.Subscribe(onRepeatedlyExecute); }
protected override void Given() { component = new TestComponent <TestEntity, string>().WithRenderingOrder(ComponentPart.Label, ComponentPart.WrapperStartTag, ComponentPart.Component, ComponentPart.ValidationMarker, ComponentPart.ValidationMessage, ComponentPart.HelpText, ComponentPart.WrapperEndTag); }
public void Subscribe(IEntity entity, Action <bool> setMouseIn, IUIEvents uiEvents, IEnabledComponent enabled, IVisibleComponent visible) { _subscribersToAdd.Enqueue(new Subscriber(entity, setMouseIn, uiEvents, enabled, visible)); }
protected override void Given() { configuration = new TestFormConfiguration(); component = Stub <IVisibleComponent>(); }
protected override void Given() { configuration = new TestFormConfiguration(); component = Stub<IVisibleComponent>(); }