//////////////////////////////////////////////////////////// /// <summary> /// Construct the sprite from a source texture /// </summary> /// <param name="texture">Source texture to assign to the sprite</param> /// <param name="rectangle">Sub-rectangle of the texture to assign to the sprite</param> //////////////////////////////////////////////////////////// public Sprite(Texture texture, IntRect rectangle) : base(sfSprite_create()) { Texture = texture; TextureRect = rectangle; }
static extern void sfSprite_setTextureRect(IntPtr CPointer, IntRect Rect);
static extern FloatRect sfTexture_getTexCoords(IntPtr texture, IntRect rectangle);
static extern IntPtr sfTexture_createFromImage(IntPtr image, ref IntRect area);
static extern IntPtr sfTexture_createFromStream(IntPtr stream, ref IntRect area);
static extern IntPtr sfTexture_createFromFile(string filename, ref IntRect area);