MCPcopy Create free account
hub / github.com/esengine/esengine / test_add_sprite

Function test_add_sprite

packages/engine-shared/src/batch/sprite_data.rs:368–386  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

366
367 #[test]
368 fn test_add_sprite() {
369 let mut buffer = SpriteBatchBuffer::new(100);
370
371 let result = buffer.add_sprite(
372 100.0, 100.0, // position
373 64.0, 64.0, // size
374 0.0, // rotation
375 0.5, 0.5, // origin
376 0.0, 0.0, 1.0, 1.0, // uvs
377 0xFFFFFFFF, // color (white)
378 1, // texture_id
379 0, // material_id
380 );
381
382 assert!(result);
383 assert_eq!(buffer.sprite_count(), 1);
384 assert_eq!(buffer.vertices().len(), 4);
385 assert_eq!(buffer.batches().len(), 1);
386 }
387
388 #[test]
389 fn test_batch_grouping() {

Callers

nothing calls this directly

Calls 1

add_spriteMethod · 0.80

Tested by

no test coverage detected