SFML.Graphics.Sprite.GetLocalBounds C# (CSharp) Method

GetLocalBounds() public method

Get the local bounding rectangle of the entity. The returned rectangle is in local coordinates, which means that it ignores the transformations (translation, rotation, scale, ...) that are applied to the entity. In other words, this function returns the bounds of the entity in the entity's coordinate system.
public GetLocalBounds ( ) : FloatRect
return FloatRect
        public FloatRect GetLocalBounds()
        {
            return sfSprite_getLocalBounds(CPointer);
        }

Usage Example

Example #1
1
 //constructor
 //Possibly requires explicit keyword
 public Aircraft(Type type, ResourceHolder<Texture, ResourceID> textures)
 {
     mType = type;
     mSprite = new Sprite(textures.get(toTextureID(type)));
     FloatRect bounds = mSprite.GetLocalBounds();
     mSprite.Origin = new Vector2f(bounds.Width / 2, bounds.Height / 2);
 }
All Usage Examples Of SFML.Graphics.Sprite::GetLocalBounds