Example #1
0
        public GameObject(Game game)
        {
            _iDrawManagerService = (IDrawManagerService)game.Services.GetService(typeof(IDrawManagerService));
            _iDrawManagerService.AddGameObject(this);

            _texture = _iDrawManagerService.SquareWhite;
            _position = Vector2.Zero;
            _sourceRectangle = new Rectangle(0, 0, _texture.Width, _texture.Height);
            _color = Color.White;
            _rotation = 0.0f;
            _origin = new Vector2((float)_sourceRectangle.Width / 2.0f, (float)_sourceRectangle.Height / 2.0f);
            SetScale(new Vector2(1.0f, 1.0f));
            SetEffects(SpriteEffects.None);
            SetLayerDepth(0.0f);
        }
Example #2
0
        public GameObject(Game game)
        {
            _iDrawManagerService = (IDrawManagerService)game.Services.GetService(typeof(IDrawManagerService));
            _iDrawManagerService.AddGameObject(this);

            _texture         = _iDrawManagerService.SquareWhite;
            _position        = Vector2.Zero;
            _sourceRectangle = new Rectangle(0, 0, _texture.Width, _texture.Height);
            _color           = Color.White;
            _rotation        = 0.0f;
            _origin          = new Vector2((float)_sourceRectangle.Width / 2.0f, (float)_sourceRectangle.Height / 2.0f);
            SetScale(new Vector2(1.0f, 1.0f));
            SetEffects(SpriteEffects.None);
            SetLayerDepth(0.0f);
        }