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);            
        }
Пример #2
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);
 }
Пример #3
0
        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 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);
 }
Пример #5
0
		public override void Init(IEntity entity)
		{
			base.Init(entity);
			_drawableInfo = entity.GetComponent<IDrawableInfo>();
			_obj = entity.GetComponent<IAnimationContainer>();
            _scale = entity.GetComponent<IScaleComponent>();
            _pixelPerfect = entity.GetComponent<IPixelPerfectComponent>();
		}
Пример #6
0
 public override void Init(IEntity entity)
 {
     base.Init(entity);
     _drawableInfo = entity.GetComponent <IDrawableInfo>();
     _obj          = entity.GetComponent <IAnimationContainer>();
     _scale        = entity.GetComponent <IScaleComponent>();
     _pixelPerfect = entity.GetComponent <IPixelPerfectComponent>();
 }
Пример #7
0
        public void Prepare(IObject obj, IDrawableInfo drawable, IViewport viewport)
        {
            _glText = _glText ?? new GLText(_graphics, _fonts, _bitmapPool);

            updateBoundingBoxes(obj, drawable, viewport);
            _bgRenderer.BoundingBoxes = _usedLabelBoundingBoxes;
            _bgRenderer.Prepare(obj, drawable, viewport);
        }
Пример #8
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);
 }
Пример #9
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);
		} 
Пример #10
0
 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>();
 }
Пример #11
0
        private void updateBoundingBoxes(IObject obj, IDrawableInfo drawable, IViewport viewport)
        {
            AutoFit autoFit = getAutoFit();

            float height = obj.Height;
            float width  = obj.Width;

            if (autoFit == AutoFit.LabelShouldFitText)
            {
                updateText(GLText.EmptySize, null);
                CustomImageSize = new SizeF(_glText.Width, _glText.Height);
            }
            else
            {
                CustomImageSize = BaseSize;
            }

            var resolutionFactor = string.IsNullOrEmpty(Text) ? AGSModelMatrixComponent.NoScaling : new PointF(GLText.TextResolutionFactorX, GLText.TextResolutionFactorY);

            CustomImageResolutionFactor = resolutionFactor;
            var  noFactor          = AGSModelMatrixComponent.NoScaling;
            bool resolutionMatches = resolutionFactor.Equals(noFactor);
            var  viewportMatrix    = drawable.IgnoreViewport ? Matrix4.Identity : _viewport.GetViewport(drawable.RenderLayer.Z).GetMatrix(viewport, drawable.RenderLayer.ParallaxSpeed);

            var modelMatrices = obj.GetModelMatrices();

            IGLMatrices textRenderMatrices = new GLMatrices {
                ModelMatrix = modelMatrices.InObjResolutionMatrix, ViewportMatrix = viewportMatrix
            };                                                                                                                                      //_textRenderMatrixBuilder.Build(_labelMatrixRenderTarget, sprite, parent, matrix, areaScaling, resolutionFactor);
            IGLMatrices labelRenderMatrices = new GLMatrices {
                ModelMatrix = modelMatrices.InVirtualResolutionMatrix, ViewportMatrix = viewportMatrix
            };                                                                                                                                           // _labelRenderMatrixBuilder.Build(_labelMatrixRenderTarget, sprite, parent, matrix, areaScaling, noFactor);
            IGLMatrices textHitTestMatrices  = resolutionMatches ? textRenderMatrices : labelRenderMatrices;
            IGLMatrices labelHitTestMatrices = labelRenderMatrices;

            updateBoundingBoxes(autoFit, textHitTestMatrices, labelHitTestMatrices, noFactor, resolutionMatches, true);
            if (!resolutionMatches)
            {
                updateBoundingBoxes(autoFit, textRenderMatrices, labelRenderMatrices, resolutionFactor, true, false);
            }
        }
Пример #12
0
 public void Prepare(IObject obj, IDrawableInfo drawable, IViewport viewport)
 {
 }
Пример #13
0
		public void Prepare(IObject obj, IDrawableInfo drawable, IInObjectTree tree, IViewport viewport, PointF areaScaling)
		{
		}