Ejemplo n.º 1
0
        public override void Start()
        {
            _texture = GetComponent <TextureComponent>();
            if (_texture == null)
            {
                throw new ArgumentNullException("ScaleComponent needs a TextureComponent attached to it");
            }

            _height = _texture.Texture.Height;
            _width  = _texture.Texture.Width;

            _oldPos = Master.Position;
        }
Ejemplo n.º 2
0
        public override void Start()
        {
            _texture   = GetComponent <TextureComponent>();
            _animation = GetComponent <AnimationComponent>();

            if (_texture != null)
            {
                _height = _texture.Texture.Height;
                _width  = _texture.Texture.Width;
            }
            else if (_animation != null)
            {
                _height = _animation.Sprite.FrameHeight;
                _width  = _animation.Sprite.FrameWidth;
            }

            _currentX = XStart;
            _currentY = YStart;
        }