10
10
[ ![ Discord] ( https://img.shields.io/discord/913957940560531456.svg?label=Loopy&logo=discord&logoColor=ffffff&color=ffffff&labelColor=000000 )] ( https://discord.gg/zrjnQzdjCB )
11
11
[ ![ MIT/Apache 2.0] ( https://img.shields.io/badge/license-MIT%2FApache-blue.svg )] ( #license )
12
12
[ ![ Following released Bevy versions] ( https://img.shields.io/badge/bevy%20tracking-released%20version-lightblue )] ( https://bevyengine.org/learn/quick-start/plugin-development/#main-branch-tracking ) \
13
- [ ![ Dependency status] ( https://deps.rs/repo/github/linebender /bevy_ogle/status.svg )] ( https://deps.rs/repo/github/linebender /bevy_ogle )
13
+ [ ![ Dependency status] ( https://deps.rs/repo/github/loopystudios /bevy_ogle/status.svg )] ( https://deps.rs/repo/github/loopystudios /bevy_ogle )
14
14
[ ![ Crates.io] ( https://img.shields.io/crates/v/bevy_ogle.svg )] ( https://crates.io/crates/bevy_ogle )
15
15
[ ![ Docs] ( https://img.shields.io/docsrs/bevy_ogle )] ( https://docs.rs/bevy_ogle )
16
- [ ![ Build status] ( https://github.com/linebender /bevy_ogle/workflows/CI/badge.svg )] ( https://github.com/linebender /bevy_ogle/actions )
16
+ [ ![ Build status] ( https://github.com/loopystudios /bevy_ogle/workflows/CI/badge.svg )] ( https://github.com/loopystudios /bevy_ogle/actions )
17
17
18
18
</div >
19
19
@@ -40,39 +40,29 @@ You can also run examples on web:
40
40
# Make sure the Rust toolchain supports the wasm32 target
41
41
rustup target add wasm32-unknown-unknown
42
42
43
- cargo run_wasm --example simple
43
+ cargo run_wasm -p demo
44
44
```
45
45
46
- ### Switch focus
46
+ ### Camera Modes
47
47
48
- You can move the camera to a focus on a specific position
48
+ The camera currently supports 3 modes, easily switched through commands.
49
49
50
50
``` rust
51
- pub fn startup ( commands : Commands ) {
52
- commands . ogle_at ( Vec2 :: new ( 0.0 , 0.0 ));
53
- }
51
+ commands . ogle_mode ( OgleMode :: Frozen ); // No camera system will be run. "User is in the menu"
52
+ commands . ogle_mode ( OgleMode :: Follow ); // Camera will follow a target.
53
+ commands . ogle_mode ( OgleMode :: Pancam ); // Camera is a debug camera controlled by the user.
54
54
```
55
55
56
- ### Follow an entity
56
+ ### Camera Target
57
57
58
- You can switch the camera focus to any entity. The entity must have a ` Transform ` , or nothing will occur .
58
+ Exclusively when the camera is in ` OgleMode::Follow ` , the camera will follow a target .
59
59
60
- ``` rust
61
- pub fn follow_player (commands : Commands , new_player : Query <Entity , Added <PlayerTag >>) {
62
- for entity in new_player . iter () {
63
- commands . ogle_follow (entity );
64
- }
65
- }
66
- ```
67
-
68
- ### Change modes
69
-
70
- You can switch camera modes easily.
60
+ There are several ways to set the target:
71
61
72
62
``` rust
73
- commands . ogle_mode ( OgleMode :: Follow ); // Camera will follow entities
74
- commands . ogle_mode ( OgleMode :: Stationary ) ; // Camera will not follow entities
75
- commands . ogle_mode ( OgleMode :: Pancam ); // Camera is only controlled through user input
63
+ commands . ogle_clear_target ( ); // Clear the target - No following is observed.
64
+ commands . ogle_target_position ( Vec2 :: new ( 0.0 , 0.0 )) ; // Camera looks at a position target.
65
+ commands . ogle_target_entity ( target_entity ); // Camera follows a target entity (must have a `Transform`).
76
66
```
77
67
78
68
## Community
0 commit comments