mirror of
https://github.com/lisk77/comet.git
synced 2025-12-12 17:18:50 +00:00
fix(examples): changed functions for atlas initialization
This commit is contained in:
parent
5a9b771967
commit
32d06c5164
2 changed files with 2 additions and 1 deletions
|
|
@ -1,6 +1,7 @@
|
||||||
use comet::prelude::*;
|
use comet::prelude::*;
|
||||||
|
|
||||||
fn setup(app: &mut App, renderer: &mut Renderer2D) {
|
fn setup(app: &mut App, renderer: &mut Renderer2D) {
|
||||||
|
renderer.init_atlas();
|
||||||
// Loading the font from the res/fonts directory with a rendered size of 77px
|
// Loading the font from the res/fonts directory with a rendered size of 77px
|
||||||
renderer.load_font("./res/fonts/PressStart2P-Regular.ttf", 77.0);
|
renderer.load_font("./res/fonts/PressStart2P-Regular.ttf", 77.0);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ use comet::prelude::*;
|
||||||
|
|
||||||
fn setup(app: &mut App, renderer: &mut Renderer2D) {
|
fn setup(app: &mut App, renderer: &mut Renderer2D) {
|
||||||
// Creating a texture atlas from the provided textures in the vector
|
// 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()]);
|
renderer.init_atlas_by_paths(vec!["./res/textures/comet_icon.png".to_string()]);
|
||||||
|
|
||||||
// Creating a camera entity
|
// Creating a camera entity
|
||||||
let cam = app.new_entity();
|
let cam = app.new_entity();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue