MCPcopy Create free account
hub / github.com/17cupsofcoffee/nova / texture_region

Method texture_region

src/graphics/batch.rs:181–199  ·  view source on GitHub ↗
(
        &mut self,
        texture: &Texture,
        position: Vec2,
        src: Rectangle,
        params: DrawParams,
    )

Source from the content-addressed store, hash-verified

179 }
180
181 pub fn texture_region(
182 &mut self,
183 texture: &Texture,
184 position: Vec2,
185 src: Rectangle,
186 params: DrawParams,
187 ) {
188 self.push_sprite(
189 Some(texture),
190 Rectangle::new(
191 src.x / texture.width() as f32,
192 src.y / texture.height() as f32,
193 src.width / texture.width() as f32,
194 src.height / texture.height() as f32,
195 ),
196 Rectangle::new(position.x, position.y, src.width, src.height),
197 params,
198 );
199 }
200
201 pub fn texture_dest(
202 &mut self,

Callers 1

text_segmentsMethod · 0.80

Calls 3

push_spriteMethod · 0.80
widthMethod · 0.45
heightMethod · 0.45

Tested by

no test coverage detected