bevy/crates
Zicklag 89217171b4 Add Sprite Flipping (#1407)
OK, here's my attempt at sprite flipping. There are a couple of points that I need review/help on, but I think the UX is about ideal:

```rust
        .spawn(SpriteBundle {
            material: materials.add(texture_handle.into()),
            sprite: Sprite {
                // Flip the sprite along the x axis
                flip: SpriteFlip { x: true, y: false },
                ..Default::default()
            },
            ..Default::default()
        });
```

Now for the issues. The big issue is that for some reason, when flipping the UVs on the sprite, there is a light "bleeding" or whatever you call it where the UV tries to sample past the texture boundry and ends up clipping. This is only noticed when resizing the window, though. You can see a screenshot below.

![image](https://user-images.githubusercontent.com/25393315/107098172-397aaa00-67d4-11eb-8e02-c90c820cd70e.png)

I am quite baffled why the texture sampling is overrunning like it is and could use some guidance if anybody knows what might be wrong.

The other issue, which I just worked around, is that I had to remove the `#[render_resources(from_self)]` annotation from the Spritesheet because the `SpriteFlip` render resource wasn't being picked up properly in the shader when using it. I'm not sure what the cause of that was, but by removing the annotation and re-organizing the shader inputs accordingly the problem was fixed.

I'm not sure if this is the most efficient way to do this or if there is a better way, but I wanted to try it out if only for the learning experience. Let me know what you think!
2021-03-03 19:26:45 +00:00
..
bevy_app Extend AppBuilder api with add_system_set and similar methods (#1453) 2021-02-19 11:36:34 -08:00
bevy_asset Add suffixes to diagnostics and other cleanup (#1505) 2021-03-03 03:43:15 +00:00
bevy_audio Non-string labels (#1423 continued) (#1473) 2021-02-18 13:20:37 -08:00
bevy_core Xtask CI (#1387) 2021-02-22 08:42:19 +00:00
bevy_derive Modify Derive to allow unit structs for RenderResources. (#1089) 2020-12-23 17:21:10 -06:00
bevy_diagnostic Add suffixes to diagnostics and other cleanup (#1505) 2021-03-03 03:43:15 +00:00
bevy_dylib release 0.4.0 (#1093) 2020-12-19 13:28:00 -06:00
bevy_dynamic_plugin update libloading (#1543) 2021-03-03 03:11:12 +00:00
bevy_ecs Add docs & example for SystemParam (#1435) 2021-03-03 03:11:11 +00:00
bevy_gilrs Non-string labels (#1423 continued) (#1473) 2021-02-18 13:20:37 -08:00
bevy_gltf Add support for gltf::Material::unlit (#1341) 2021-01-31 17:13:16 -08:00
bevy_input Added Hash and Deserialize/Serialize traits to ElementState (#1447) 2021-02-22 03:59:37 +00:00
bevy_internal Subpixel text positioning (#1196) 2021-01-03 12:39:11 -08:00
bevy_log System sets and parallel executor v2 (#1144) 2021-02-09 12:14:10 -08:00
bevy_math More types (#1267) 2021-01-21 16:05:23 -08:00
bevy_pbr Non-string labels (#1423 continued) (#1473) 2021-02-18 13:20:37 -08:00
bevy_reflect Xtask CI (#1387) 2021-02-22 08:42:19 +00:00
bevy_render keep track of type name in NodeState (#1444) 2021-02-22 09:15:29 +00:00
bevy_scene Non-string labels (#1423 continued) (#1473) 2021-02-18 13:20:37 -08:00
bevy_sprite Add Sprite Flipping (#1407) 2021-03-03 19:26:45 +00:00
bevy_tasks Xtask CI (#1387) 2021-02-22 08:42:19 +00:00
bevy_text Add Sprite Flipping (#1407) 2021-03-03 19:26:45 +00:00
bevy_transform Moved benchmarks to a single place (#1477) 2021-02-19 22:11:00 +00:00
bevy_ui rename bevy_ui::node module so that bevy_ui::render::node isn't shadowed (#1464) 2021-02-22 04:33:33 +00:00
bevy_utils Update ahash requirement from 0.6.1 to 0.7.0 (#1370) 2021-02-01 13:29:54 -08:00
bevy_wgpu Non-string labels (#1423 continued) (#1473) 2021-02-18 13:20:37 -08:00
bevy_window Add Window Resize Constraints (#1409) 2021-03-03 02:56:50 +00:00
bevy_winit Add Window Resize Constraints (#1409) 2021-03-03 02:56:50 +00:00