You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
 
 
space-editor/src/main.rs

67 lines
1.5 KiB

use std::env;
pub use data::*;
pub use events::*;
pub use views::*;
pub use widgets::*;
mod data;
mod events;
mod views;
mod widgets;
use orbgame::{
theme::{COLORS_RON, FONTS_RON},
theming::config::ThemeConfig,
};
#[cfg(not(feature = "light"))]
use orbgame::theme::DARK_THEME_RON;
#[cfg(feature = "light")]
use orbgame::theme::LIGHT_THEME_RON;
// --- THEME --
#[cfg(not(feature = "light"))]
static DARK_EXT: &'static str = include_str!("theme/dark_theme.ron");
#[cfg(not(feature = "light"))]
fn theme() -> Theme {
Theme::from_config(
ThemeConfig::from(DARK_THEME_RON)
.extend(ThemeConfig::from(DARK_EXT))
.extend(ThemeConfig::from(COLORS_RON))
.extend(ThemeConfig::from(FONTS_RON)),
)
}
#[cfg(feature = "light")]
static LIGHT_EXT: &'static str = include_str!("theme/light_theme.ron");
#[cfg(feature = "light")]
fn theme() -> Theme {
Theme::from_config(
ThemeConfig::from(LIGHT_THEME_RON)
.extend(ThemeConfig::from(LIGHT_EXT))
.extend(ThemeConfig::from(COLORS_RON))
.extend(ThemeConfig::from(FONTS_RON)),
)
}
// --- THEME --
fn main() {
Game::new()
.theme(theme())
.window(move |ctx| {
let args: Vec<String> = env::args().collect();
Window::new()
.title("Space Editor")
.position((100.0, 100.0))
.size(1028.0, 768.0)
.child(MainView::new().config(Config::from(args)).build(ctx))
.build(ctx)
})
.run();
}