mirror of
https://github.com/lisk77/comet.git
synced 2025-10-23 21:38:50 +00:00
chore: renamed the resources directory to res
This commit is contained in:
parent
05a4679f38
commit
913f200a63
22 changed files with 1273 additions and 1105 deletions
|
|
@ -1,32 +1,32 @@
|
|||
use comet::prelude::*;
|
||||
|
||||
fn setup(app: &mut App, renderer: &mut Renderer2D) {
|
||||
// Creating a texture atlas from the provided textures in the vector
|
||||
renderer.set_texture_atlas_by_paths(vec!["./resources/textures/comet_icon.png".to_string()]);
|
||||
// Creating a texture atlas from the provided textures in the vector
|
||||
renderer.set_texture_atlas_by_paths(vec!["./res/textures/comet_icon.png".to_string()]);
|
||||
|
||||
// Creating a camera entity
|
||||
let cam = app.new_entity();
|
||||
app.add_component(cam, Transform2D::new());
|
||||
app.add_component(cam, Camera2D::new(v2::new(2.0, 2.0), 1.0, 1));
|
||||
// Creating a camera entity
|
||||
let cam = app.new_entity();
|
||||
app.add_component(cam, Transform2D::new());
|
||||
app.add_component(cam, Camera2D::new(v2::new(2.0, 2.0), 1.0, 1));
|
||||
|
||||
// Creating a textured entity
|
||||
let e0 = app.new_entity();
|
||||
app.add_component(e0, Transform2D::new());
|
||||
// Creating a textured entity
|
||||
let e0 = app.new_entity();
|
||||
app.add_component(e0, Transform2D::new());
|
||||
|
||||
let mut render = Render2D::new();
|
||||
render.set_visibility(true);
|
||||
render.set_texture("./resources/textures/comet_icon.png");
|
||||
let mut render = Render2D::new();
|
||||
render.set_visibility(true);
|
||||
render.set_texture("./res/textures/comet_icon.png");
|
||||
|
||||
app.add_component(e0, render);
|
||||
app.add_component(e0, render);
|
||||
}
|
||||
|
||||
fn update(app: &mut App, renderer: &mut Renderer2D, dt: f32) {
|
||||
renderer.render_scene_2d(app.scene())
|
||||
renderer.render_scene_2d(app.scene())
|
||||
}
|
||||
|
||||
fn main() {
|
||||
App::new()
|
||||
.with_title("Textured Entity")
|
||||
.with_preset(App2D)
|
||||
.run::<Renderer2D>(setup, update);
|
||||
}
|
||||
App::new()
|
||||
.with_title("Textured Entity")
|
||||
.with_preset(App2D)
|
||||
.run::<Renderer2D>(setup, update);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue