mirror of
https://github.com/bevyengine/bevy
synced 2024-11-10 07:04:33 +00:00
8067e46049
# Objective Provide an example of how to achieve pixel-perfect "grid snapping" in 2D via rendering to a texture. This is a common use case in retro pixel art game development. ## Solution Render sprites to a canvas via a Camera, then use another (scaled up) Camera to render the resulting canvas to the screen. This example is based on the `3d/render_to_texture.rs` example. Furthermore, this example demonstrates mixing retro-style graphics with high-resolution graphics, as well as pixel-snapped rendering of a `MaterialMesh2dBundle`. |
||
---|---|---|
.. | ||
2d_gizmos.rs | ||
2d_shapes.rs | ||
2d_viewport_to_world.rs | ||
bloom_2d.rs | ||
custom_gltf_vertex_attribute.rs | ||
mesh2d.rs | ||
mesh2d_manual.rs | ||
mesh2d_vertex_color_texture.rs | ||
move_sprite.rs | ||
pixel_grid_snap.rs | ||
rotation.rs | ||
sprite.rs | ||
sprite_flipping.rs | ||
sprite_sheet.rs | ||
text2d.rs | ||
texture_atlas.rs | ||
transparency_2d.rs |