* add normalized orthographic projection * custom scale for ScaledOrthographicProjection * allow choosing base axis for ScaledOrthographicProjection * cargo fmt * add general (scaled) orthographic camera bundle FIXME: does the same "far" trick from Camera2DBundle make any sense here? * fixes * camera bundles: rename and new ortho constructors * unify orthographic projections * give PerspectiveCameraBundle constructors like those of OrthographicCameraBundle * update examples with new camera bundle syntax * rename CameraUiBundle to UiCameraBundle * update examples * ScalingMode::None * remove extra blank lines * sane default bounds for orthographic projection * fix alien_cake_addict example * reorder ScalingMode enum variants * ios example fix
		
			
				
	
	
		
			23 lines
		
	
	
		
			547 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
			
		
		
	
	
			23 lines
		
	
	
		
			547 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
| use bevy::prelude::*;
 | |
| 
 | |
| fn main() {
 | |
|     App::build()
 | |
|         .add_plugins(DefaultPlugins)
 | |
|         .add_startup_system(setup.system())
 | |
|         .run();
 | |
| }
 | |
| 
 | |
| fn setup(
 | |
|     commands: &mut Commands,
 | |
|     asset_server: Res<AssetServer>,
 | |
|     mut materials: ResMut<Assets<ColorMaterial>>,
 | |
| ) {
 | |
|     let texture_handle = asset_server.load("branding/icon.png");
 | |
|     commands
 | |
|         .spawn(OrthographicCameraBundle::new_2d())
 | |
|         .spawn(SpriteBundle {
 | |
|             material: materials.add(texture_handle.into()),
 | |
|             ..Default::default()
 | |
|         });
 | |
| }
 |