Questions tagged [bevy]

A cross-platform, massively parallel game engine with an entity component system and 2D and 3D renderers.

Read more at the official website.

161 questions
15
votes
2 answers

How can I manually create meshes in bevy with vertices?

What do I have to do to to create a mesh for bevy with the following vertices: let mut vertices : Vec<[f32; 3]> = Vec::new(); vertices.push([0.0, 0.0, 0.0]); vertices.push([1.0, 2.0, 1.0]); vertices.push([2.0, 0.0, 0.0]); I then want…
Bruno Wallner
  • 383
  • 5
  • 13
11
votes
0 answers

How to run a Bevy app with default plugins without a GPU?

My laptop doesn't have a dedicated GPU. I run elementary OS 5 on this laptop, which has an integrated GPU. When I try running my beginner's Bevy app, use bevy::prelude::*; fn main() { App::build() .add_default_plugins() …
Arun Parolikkal
  • 127
  • 1
  • 8
11
votes
3 answers

How, with Bevy, can you get and set Window information after creation?

I want to be able to read and set window-settings with Bevy. I attempted to do so with a basic system: fn test_system(mut win_desc: ResMut) { win_desc.title = "test".to_string(); println!("{}",win_desc.title); } While this…
STF_ZBR
  • 617
  • 1
  • 4
  • 19
11
votes
2 answers

Reading the Position of a Mouse click in Bevy

I am trying to see where the mouse is pressed so I can select my character. I have tried the following #[derive(Default)] struct State { // Set up from example mouse_button_event_reader: EventReader, …
Will
  • 1,059
  • 2
  • 10
  • 22
8
votes
2 answers

How to read Bevy events without consuming them?

I am currently trying to use events to signal when the character jumps in my Bevy game. I want the system that handles player inputs to send a JumpedEvent which can then be received by other systems to perform the appropriate actions (set the…
EtTuBrute
  • 502
  • 5
  • 16
8
votes
1 answer

How does Bevy "scope" its systems based on the type of the arguments?

Bevy, a new Rust game engine and ECS, has a feature where it "scopes" its systems based on the type of the arguments. From its docs: The parameters we pass in to a "system function" define what entities the system runs on. In this case,…
Rodney Folz
  • 6,709
  • 2
  • 29
  • 38
7
votes
1 answer

Is the default font in Bevy unusable?

When attempting to print "Hello, world!" to the screen with Bevy, the text would not display until I imported a third-party font file and loaded it as an asset to use as the font value in the TextStyle value of the Text component. Prior to using…
Connor Mooneyhan
  • 547
  • 6
  • 17
7
votes
1 answer

Dot Zero call to timer in Rust/Bevy?

In the Bevy book the following code is used: struct GreetTimer(Timer); fn greet_people( time: Res
BWStearns
  • 2,567
  • 2
  • 19
  • 33
7
votes
1 answer

How to manipulate the rendergraph in Bevy

I would like to be able to get the previously rendered frame and use that as a sampler in the current frame. There is a good set of example code in the Bevy repository to show me how to apply custom shaders as materials to a mesh. But I would like…
vivichrist
  • 309
  • 2
  • 9
7
votes
2 answers

How do I convert screen space to world space coords in Bevy using Camera2dComponents?

Using Res> I can get the mouse position change in screen space coordinates (zero in bottom-left corner), e.g. #[derive(Default)] struct State { cursor_moved_reader: EventReader, } fn set_mouse_pos(mut state:…
Jakub Arnold
  • 85,596
  • 89
  • 230
  • 327
7
votes
2 answers

How to do a nested query in a Bevy system?

I'm working on a little boids toy with Bevy, and each boid's velocity/acceleration depends on the position and velocity values of the boids around it. This means that for each boid, I want to run some logic that depends on some subset of the other…
peter
  • 91
  • 6
6
votes
1 answer

How to make async system function in the bevy game engine?

I am currently working on a 3D voxel-based game and I want to have procedural generated chunks based on player movement. But running the chunk generation in a simple system results in huge FPS drops. I already tried to create a task pool that runs…
BrunoWallner
  • 417
  • 3
  • 10
6
votes
1 answer

How can I despawn an entity in bevy 0.5.0 that was spawned with commands.spawn_bundle()

This is a very simple question. I already rewrote my code to work with the syntax and other changes, that came with the new version of bevy. Everything seems to work when compiling, except the despawning of an entity. I spawn in said entity…
Bruno Wallner
  • 383
  • 5
  • 13
6
votes
1 answer

Is there a way of detecting collision of Sprites in the bevy game engine?

Currently im using the Position of two objects (comets and the ship) to detect if they collide. fn collision_detection( comets: Query<&Transform, With>, mut ships: Query<(&Transform, &mut ShipStatus), With>, ) { for comet in…
Bruno Wallner
  • 383
  • 5
  • 13
6
votes
1 answer

How can you change a SpriteComponent color?

I have a query system that finds an object in which the mouse is over. This is not a button, but, I wish to change the color. I'm not sure where to start. What property would I query and how would I change it? Currently, I have the following: fn…
STF_ZBR
  • 617
  • 1
  • 4
  • 19
1
2 3
10 11