summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
Diffstat (limited to 'client')
-rw-r--r--client/src/interfaces/mod.rs7
-rw-r--r--client/src/ui.rs7
2 files changed, 10 insertions, 4 deletions
diff --git a/client/src/interfaces/mod.rs b/client/src/interfaces/mod.rs
index 9dfce63..9a68da7 100644
--- a/client/src/interfaces/mod.rs
+++ b/client/src/interfaces/mod.rs
@@ -17,8 +17,10 @@
pub mod prefabindex;
pub mod profiler;
-use crate::{download::Downloader, network::Network, scene_prepare::ScenePreparer};
-use egui::Widget;
+use crate::{
+ download::Downloader, network::Network, scene_prepare::ScenePreparer, ui::UI_POSITION_OFFSET,
+};
+use egui::{Pos2, Widget};
use prefabindex::PrefabIndexInterface;
use profiler::{Profiler, TimingProfiler};
use std::sync::{Arc, Mutex};
@@ -51,6 +53,7 @@ pub fn ui_selector(idata: Arc<InterfaceData>) -> impl Fn(&egui::Context) -> bool
Interface::PrefabIndex(_) => "Prefab Index",
})
.open(&mut open)
+ .default_pos(Pos2::new(UI_POSITION_OFFSET, UI_POSITION_OFFSET))
.show(ctx, |ui| match &mut *state {
Interface::Selector => {
if ui.button("Profiler").clicked() {
diff --git a/client/src/ui.rs b/client/src/ui.rs
index 98d8147..92de3c8 100644
--- a/client/src/ui.rs
+++ b/client/src/ui.rs
@@ -19,7 +19,7 @@ use egui::{
Context, Event, ImageData, PointerButton, TextureId, ViewportId, ViewportInfo,
epaint::{ImageDelta, Primitive, Vertex},
};
-use glam::{Affine3A, Mat2, Mat3, Mat4, Vec2, Vec3Swizzles, Vec4Swizzles, vec2, vec4};
+use glam::{Affine3A, Mat2, Mat3, Mat4, Vec2, Vec3, Vec3Swizzles, Vec4Swizzles, vec2, vec4};
use log::{info, warn};
use rand::random;
use std::{
@@ -45,6 +45,8 @@ use wgpu::{
};
use winit::event::MouseButton;
+pub const UI_POSITION_OFFSET: f32 = 1000.;
+
pub struct UiRenderer {
device: Arc<Device>,
queue: Arc<Queue>,
@@ -334,7 +336,8 @@ impl UiRenderer {
* Mat4::from_mat3a(surf.transform.matrix3)
* Mat4::from_mat3(Mat3::from_mat2(Mat2::from_cols_array(&[
scale, 0., 0., -scale,
- ])));
+ ])))
+ * Mat4::from_translation(-Vec3::new(UI_POSITION_OFFSET, UI_POSITION_OFFSET, 0.));
let screen_size = vec2(
surface_configuration.width as f32,