tirbofish/dropbear · diff
feature: created a new grid for the UI editor with pan and zoom.
Signature present but could not be verified.
Unverified
@@ -251,7 +251,7 @@ fn collect_available_animations( ), c )] -fn animation_component_exists_for_entity( +fn exists_for_entity( #[dropbear_macro::define(WorldPtr)] world: &World, #[dropbear_macro::entity] entity: Entity, ) -> DropbearNativeResult<bool> { @@ -1,15 +1,419 @@ +use std::sync::Arc; +use bytemuck::{Pod, Zeroable}; +use dropbear_engine::graphics::SharedGraphicsContext; +use egui::TextureId; +use glam::{Mat4, Vec2, Vec4}; +use kino_ui::camera::Camera2D; +use wgpu::TextureFormat; + +pub mod viewport; + pub struct UiEditor { + pub grid_pipeline: Option<UIGridPipeline>, + pub active_entity: Option<hecs::Entity>, + pub camera: Camera2D, + zoom: f32, + camera_position: Vec2, } impl UiEditor { pub fn new() -> Self { + let mut camera = Camera2D::default(); + camera.set_zoom(1.0); + camera.target(Vec2::ZERO); + Self { + grid_pipeline: None, active_entity: None, + camera, + zoom: 1.0, + camera_position: Vec2::ZERO, }
Large diffs are not rendered by default. Showing the first 50 of 691 lines. Show full diff