class SFML::Sprite

A textured rectangle. SFML 3 requires a Texture at construction time (no default-constructible Sprite anymore), so we keep the texture reference alive inside the Ruby Sprite to prevent the GC from freeing the GPU resource while it’s still being drawn.

tex = SFML::Texture.load(“hero.png”) sprite = SFML::Sprite.new(tex, position: [100, 100]) window.draw(sprite)