mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-11-25 11:44:25 +03:00
make background color configurable
This commit is contained in:
parent
5ce158cb90
commit
b3267bb2e7
@ -1,5 +1,11 @@
|
||||
{
|
||||
"map": {
|
||||
"Background": [
|
||||
1.0,
|
||||
1.0,
|
||||
1.0,
|
||||
1.0
|
||||
],
|
||||
"Debug": [
|
||||
1.0,
|
||||
0.0,
|
||||
|
@ -10,6 +10,7 @@ use strum::IntoEnumIterator;
|
||||
#[derive(Debug, PartialEq, Eq, Serialize, Deserialize, EnumIter, EnumString, ToString,
|
||||
PartialOrd, Ord, Clone, Copy)]
|
||||
pub enum Colors {
|
||||
Background,
|
||||
Debug,
|
||||
BrightDebug,
|
||||
Road,
|
||||
|
@ -87,10 +87,6 @@ fn main() {
|
||||
|
||||
if let Some(args) = ev.render_args() {
|
||||
gl.draw(args.viewport(), |c, g| {
|
||||
use graphics::clear;
|
||||
|
||||
clear([1.0; 4], g);
|
||||
|
||||
ui.draw(
|
||||
&mut ezgui::canvas::GfxCtx {
|
||||
glyphs,
|
||||
|
@ -14,6 +14,7 @@ use ezgui::ToggleableLayer;
|
||||
use ezgui::canvas::{Canvas, GfxCtx};
|
||||
use ezgui::input::UserInput;
|
||||
use geom;
|
||||
use graphics;
|
||||
use graphics::types::Color;
|
||||
use map_model::IntersectionID;
|
||||
use piston::input::{Key, MouseCursorEvent};
|
||||
@ -303,6 +304,8 @@ impl UI {
|
||||
}
|
||||
|
||||
pub fn draw(&self, g: &mut GfxCtx, input: UserInput) {
|
||||
graphics::clear(self.cs.get(Colors::Background), g.gfx);
|
||||
|
||||
g.ctx = self.canvas.get_transformed_context(&g.orig_ctx);
|
||||
|
||||
let screen_bbox = self.canvas.get_screen_bbox(&g.window_size);
|
||||
|
Loading…
Reference in New Issue
Block a user