Closed fililip closed 1 year ago
You can already draw subsections of a texture via Texture::draw_region
- does that function not fulfil your needs?
For context, before 0.6, DrawParams
used to have a clip
parameter that did the same thing as texture_offset
. I was never totally happy with this though, as it made things confusing when drawing things that aren't textures (what would it mean to clip
a Mesh
, for example?).
Oh, I'm terribly sorry, I didn't notice that function at all. Yes, it does fulfil my needs.
Thanks for the help!
Add the ability to draw texture parts, as opposed to whole textures only. This branch adds a
texture_offset: Vec4
parameter toDrawParams
, as well as its initializer function.Marking this as draft as I'm unsure whether using
scale
andtexture_offset
is a good idea compared to implementing something like aRectangle
class from MonoGame/XNA. I'm open to suggestions.