Skip to content

Commit

Permalink
Set up text / font stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
benfrankel committed Dec 3, 2023
1 parent 4e18daf commit b5ad821
Show file tree
Hide file tree
Showing 41 changed files with 218 additions and 56 deletions.
61 changes: 30 additions & 31 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file removed assets/font/Kenney/Kenney Blocks.ttf
Binary file not shown.
Binary file removed assets/font/Kenney/Kenney Future Narrow.ttf
Binary file not shown.
Binary file removed assets/font/Kenney/Kenney Future.ttf
Binary file not shown.
Binary file removed assets/font/Kenney/Kenney High Square.ttf
Binary file not shown.
Binary file removed assets/font/Kenney/Kenney High.ttf
Binary file not shown.
Binary file removed assets/font/Kenney/Kenney Mini Square Mono.ttf
Binary file not shown.
Binary file removed assets/font/Kenney/Kenney Mini Square.ttf
Binary file not shown.
Binary file removed assets/font/Kenney/Kenney Mini.ttf
Binary file not shown.
Binary file removed assets/font/Kenney/Kenney Pixel Square.ttf
Binary file not shown.
Binary file removed assets/font/Kenney/Kenney Pixel.ttf
Binary file not shown.
Binary file removed assets/font/Kenney/Kenney Rocket Square.ttf
Binary file not shown.
Binary file removed assets/font/Kenney/Kenney Rocket.ttf
Binary file not shown.
Binary file added assets/font/PyriousPixel-B.ttf
Binary file not shown.
Binary file added assets/font/PyriousPixel-R.ttf
Binary file not shown.
Binary file added assets/font/PyriousPixel.aseprite
Binary file not shown.
Binary file removed assets/font/anna anthropy/Chubster.ttf
Binary file not shown.
Binary file removed assets/font/anna anthropy/CryptOfTomorrow.ttf
Binary file not shown.
Binary file removed assets/font/anna anthropy/Floatpoints.ttf
Binary file not shown.
Binary file removed assets/font/anna anthropy/FrogPrincess.ttf
Binary file not shown.
Binary file removed assets/font/anna anthropy/GhostButler.ttf
Binary file not shown.
Binary file removed assets/font/anna anthropy/Jaywalk.ttf
Binary file not shown.
Binary file removed assets/font/anna anthropy/ListenHereMiss.ttf
Binary file not shown.
Binary file removed assets/font/anna anthropy/Magic Forest.ttf
Binary file not shown.
Binary file removed assets/font/anna anthropy/PlanetGemrule.ttf
Binary file not shown.
Binary file removed assets/font/anna anthropy/Slanted.ttf
Binary file not shown.
Binary file removed assets/font/anna anthropy/TroubleBeneathTheDome.ttf
Binary file not shown.
Binary file removed assets/font/anna anthropy/WildBillYonder.ttf
Binary file not shown.
Binary file removed assets/font/anna anthropy/Witchqueen.ttf
Binary file not shown.
Binary file removed assets/font/anna anthropy/Wizard's Manse.otf
Binary file not shown.
Binary file removed assets/font/anna anthropy/cyber-druids.ttf
Binary file not shown.
Binary file removed assets/font/anna anthropy/dysin4mation.ttf
Binary file not shown.
Binary file modified mockup/editor_ui.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 6 additions & 3 deletions src/camera.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,19 @@ impl Plugin for CameraPlugin {
}
}

pub const CAMERA_WIDTH: f32 = 320.0;
pub const CAMERA_HEIGHT: f32 = 180.0;

fn spawn_camera(mut commands: Commands, mut root: ResMut<AppRoot>) {
root.camera = commands
.spawn((
Name::new("MainCamera"),
Camera2dBundle {
projection: OrthographicProjection {
near: -1000.0,
scaling_mode: ScalingMode::AutoMax {
max_width: 1920.0,
max_height: 1080.0,
scaling_mode: ScalingMode::Fixed {
width: CAMERA_WIDTH,
height: CAMERA_HEIGHT,
},
..default()
},
Expand Down
2 changes: 1 addition & 1 deletion src/debug.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ impl Plugin for DebugPlugin {
// Editor
if self.editor {
app.add_plugins(EditorPlugin::new().in_new_window(Window {
mode: WindowMode::BorderlessFullscreen,
mode: WindowMode::Windowed,
title: "bevy_editor_pls".to_string(),
focused: false,
..default()
Expand Down
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ impl Plugin for AppPlugin {
app.add_plugins(debug::DebugPlugin {
ambiguity_detection: false,
//editor: false,
start: state::AppState::TitleScreen,
..default()
});
}
Expand Down
6 changes: 3 additions & 3 deletions src/state/end_screen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use leafwing_input_manager::prelude::*;
use crate::config::Config;
use crate::state::AppState;
use crate::state::AppState::*;
use crate::ui::FONT_HANDLE;
use crate::ui::BOLD_FONT_HANDLE;
use crate::AppRoot;

pub struct EndScreenStatePlugin;
Expand All @@ -34,7 +34,7 @@ impl Plugin for EndScreenStatePlugin {
#[reflect(Resource)]
pub struct EndScreenAssets {}

#[derive(Actionlike, Reflect, Clone)]
#[derive(Actionlike, Reflect, PartialEq, Eq, Hash, Clone)]
enum EndScreenAction {
Restart,
Quit,
Expand Down Expand Up @@ -81,7 +81,7 @@ fn enter_end_screen(mut commands: Commands, root: Res<AppRoot>, config: Res<Conf
text: Text::from_section(
"The End",
TextStyle {
font: FONT_HANDLE,
font: BOLD_FONT_HANDLE,
font_size: 64.0,
color: config.fg_color,
},
Expand Down
4 changes: 2 additions & 2 deletions src/state/loading_screen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use iyes_progress::prelude::*;
use crate::config::Config;
use crate::state::game::GameAssets;
use crate::state::AppState::*;
use crate::ui::FONT_HANDLE;
use crate::ui::BOLD_FONT_HANDLE;
use crate::AppRoot;

pub struct LoadingScreenStatePlugin;
Expand Down Expand Up @@ -76,7 +76,7 @@ fn enter_loading(mut commands: Commands, root: Res<AppRoot>, config: Res<Config>
text: Text::from_section(
"Loading...",
TextStyle {
font: FONT_HANDLE,
font: BOLD_FONT_HANDLE,
font_size: 64.0,
color: config.fg_color,
},
Expand Down
Loading

0 comments on commit b5ad821

Please sign in to comment.