示例#1
0
 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 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);            
        }
示例#4
0
        public override void Init(IEntity entity)
        {
            base.Init(entity);
            _textComponent  = entity.GetComponent <ITextComponent>();
            _imageComponent = entity.GetComponent <IImageComponent>();
            _uiEvents       = entity.GetComponent <IUIEvents>();
            _tree           = entity.GetComponent <IInObjectTree>();
            _room           = entity.GetComponent <IHasRoom>();
            var visible = entity.GetComponent <IVisibleComponent>();

            _game.Events.OnRepeatedlyExecute.Subscribe((_, __) =>
            {
                if (!visible.Visible)
                {
                    IsFocused = false;
                }
            });

            _caretFlashCounter = (int)CaretFlashDelay;
            _withCaret         = _game.Factory.UI.GetLabel(entity.ID + " Caret", "|", 1f, 1f, 0f, 0f, new AGSTextConfig(autoFit: AutoFit.LabelShouldFitText));
            _withCaret.Anchor  = new PointF(0f, 0f);

            _game.Events.OnBeforeRender.Subscribe(onBeforeRender);
            _uiEvents.MouseDown.Subscribe(onMouseDown);
            _uiEvents.LostFocus.Subscribe(onMouseDownOutside);
        }
示例#5
0
 public override void Init(IEntity entity)
 {
     base.Init(entity);
     DropDownPanel         = _uiFactory.GetPanel(entity.ID + "_Panel", new EmptyImage(1f, 1f), 0f, 0f);
     DropDownPanel.Visible = false;
     _tree = entity.GetComponent <IInObjectTree>();
 }
 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);
 }
示例#7
0
 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(IEntity entity)
 {
     base.Init(entity);
     _entity    = entity;
     _animation = entity.GetComponent <IAnimationContainer>();
     _tree      = entity.GetComponent <IInObjectTree>();
     _scale     = entity.GetComponent <IScaleComponent>();
     _translate = entity.GetComponent <ITranslateComponent>();
     _rotate    = entity.GetComponent <IRotateComponent>();
     _image     = entity.GetComponent <IImageComponent>();
     _room      = entity.GetComponent <IHasRoom>();
     _drawable  = entity.GetComponent <IDrawableInfo>();
 }
示例#10
0
        public override void Init(IEntity entity)
        {
            base.Init(entity);
            _textComponent = entity.GetComponent<ITextComponent>();
            _imageComponent = entity.GetComponent<IImageComponent>();
            _uiEvents = entity.GetComponent<IUIEvents>();
            _tree = entity.GetComponent<IInObjectTree>();
            _room = entity.GetComponent<IHasRoom>();

            _caretFlashCounter = (int)CaretFlashDelay;
            _withCaret = _game.Factory.UI.GetLabel(entity.ID + " Caret", "|", 1f, 1f, 0f, 0f, new AGSTextConfig(autoFit: AutoFit.LabelShouldFitText));
            _withCaret.Anchor = new PointF(0f, 0f);

            _game.Events.OnBeforeRender.Subscribe(onBeforeRender);
            _uiEvents.MouseDown.Subscribe(onMouseDown);
            _uiEvents.LostFocus.Subscribe(onMouseDownOutside);
        }
		public override void Init(IEntity entity)
		{
			base.Init(entity);
			_scale = entity.GetComponent<IScaleComponent>();
			_tree = entity.GetComponent<IInObjectTree>();
		}
 public override void Init(IEntity entity)
 {
     base.Init(entity);
     DropDownPanel = _uiFactory.GetPanel(entity.ID + "_Panel", new EmptyImage(1f, 1f), 0f, 0f);
     DropDownPanel.Visible = false;
     _tree = entity.GetComponent<IInObjectTree>();
 }
示例#13
0
		public void Prepare(IObject obj, IDrawableInfo drawable, IInObjectTree tree, IViewport viewport, PointF areaScaling)
		{
		}
示例#14
0
 public override void Init(IEntity entity)
 {
     base.Init(entity);
     _tree = entity.GetComponent <IInObjectTree>();
 }