UI fix
This commit is contained in:
parent
5a8ead0046
commit
42d054e72a
Binary file not shown.
|
Before Width: | Height: | Size: 211 KiB After Width: | Height: | Size: 1.1 MiB |
BIN
data/menu.ui
BIN
data/menu.ui
Binary file not shown.
BIN
data/scene.rgs
BIN
data/scene.rgs
Binary file not shown.
|
|
@ -1,6 +1,7 @@
|
||||||
//! Game project.
|
//! Game project.
|
||||||
use fyrox::core::color::Color;
|
use fyrox::core::color::Color;
|
||||||
use fyrox::graph::SceneGraph;
|
use fyrox::graph::SceneGraph;
|
||||||
|
use fyrox::gui::Thickness;
|
||||||
use fyrox::{
|
use fyrox::{
|
||||||
asset::manager::ResourceManager,
|
asset::manager::ResourceManager,
|
||||||
core::{
|
core::{
|
||||||
|
|
@ -11,6 +12,7 @@ use fyrox::{
|
||||||
engine::GraphicsContext,
|
engine::GraphicsContext,
|
||||||
event::{Event, WindowEvent},
|
event::{Event, WindowEvent},
|
||||||
gui::{
|
gui::{
|
||||||
|
font::Font,
|
||||||
brush::Brush,
|
brush::Brush,
|
||||||
button::ButtonMessage,
|
button::ButtonMessage,
|
||||||
grid::{Column, GridBuilder, Row},
|
grid::{Column, GridBuilder, Row},
|
||||||
|
|
@ -255,14 +257,17 @@ impl Plugin for Game {
|
||||||
ArcherSpawn::new().spawn_enemy(graph, resource_manager, -25.0);
|
ArcherSpawn::new().spawn_enemy(graph, resource_manager, -25.0);
|
||||||
}
|
}
|
||||||
let ui_ctx = &mut context.user_interface.build_ctx();
|
let ui_ctx = &mut context.user_interface.build_ctx();
|
||||||
|
let font_to_level = resource_manager.request::<Font>("data/cd2f1-36d91_sunday.ttf".to_owned());
|
||||||
self.level_node = GridBuilder::new(
|
self.level_node = GridBuilder::new(
|
||||||
WidgetBuilder::new().with_child(
|
WidgetBuilder::new().with_child(
|
||||||
TextBuilder::new(WidgetBuilder::new().with_foreground(Brush::Solid(Color::BLACK)))
|
TextBuilder::new(WidgetBuilder::new().with_foreground(Brush::Solid(Color::opaque(192, 34, 9))))
|
||||||
.with_text(format!("Level: {}", self.level))
|
.with_text(format!("Уровень: {}", self.level))
|
||||||
.with_font_size(20.0)
|
.with_font_size(20.0)
|
||||||
|
.with_font(font_to_level)
|
||||||
|
.with_shadow_brush(Brush::Solid(Color::RED))
|
||||||
.build(ui_ctx),
|
.build(ui_ctx),
|
||||||
),
|
)
|
||||||
|
.with_margin(Thickness::top_left(10.0))
|
||||||
)
|
)
|
||||||
.add_row(Row::stretch())
|
.add_row(Row::stretch())
|
||||||
.add_column(Column::auto())
|
.add_column(Column::auto())
|
||||||
|
|
|
||||||
|
|
@ -128,8 +128,16 @@ fn build_ground_block(resource_manager: &ResourceManager, graph: &mut Graph, x:
|
||||||
y,
|
y,
|
||||||
1.0,
|
1.0,
|
||||||
build_material(resource_manager, "assets/data/tiles/2.png".to_owned()),
|
build_material(resource_manager, "assets/data/tiles/2.png".to_owned()),
|
||||||
|
shape.clone(),
|
||||||
|
);
|
||||||
|
build_block(
|
||||||
|
graph,
|
||||||
|
x as f32,
|
||||||
|
y-1.0,
|
||||||
|
1.0,
|
||||||
|
build_material(resource_manager, "assets/data/tiles/5.png".to_owned()),
|
||||||
shape,
|
shape,
|
||||||
)
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn build_center_block(resource_manager: &ResourceManager, graph: &mut Graph, x: f32, y: f32) {
|
fn build_center_block(resource_manager: &ResourceManager, graph: &mut Graph, x: f32, y: f32) {
|
||||||
|
|
|
||||||
1228
settings.ron
1228
settings.ron
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue