From 3a639142822dae42763aed012e79cb85f30816e6 Mon Sep 17 00:00:00 2001 From: Ed_ Date: Tue, 5 Mar 2024 10:20:18 -0500 Subject: [PATCH] Deleting entity_box2 for now as its not needed --- code/entity_box2.odin | 41 ----------------------------------------- 1 file changed, 41 deletions(-) delete mode 100644 code/entity_box2.odin diff --git a/code/entity_box2.odin b/code/entity_box2.odin deleted file mode 100644 index 73ef64c..0000000 --- a/code/entity_box2.odin +++ /dev/null @@ -1,41 +0,0 @@ -package sectr - -import "core:encoding/json" - -import rl "vendor:raylib" - -// TODO(Ed) : I made this before doing Ryan's UI series. It was my initial attempt at a "frame" -// conceptually that I need as an Entity primitive for all my 2D primitives that I would lay out -// in either world (workspace) space or in screenspace (fixed ui space) - -Box2 :: struct { - position : Vec2, - extent : Extents2, - color : Color, - layer : i32, -} - -box_size :: proc( box : ^ Box2 ) -> AreaSize { - return transmute(AreaSize) box.extent * 2.0 -} - -box_get_bounds :: proc( box : ^ Box2 ) -> Bounds2 { - top_left := box.position + Vec2 { -box.extent.x, box.extent.y } - bottom_right := box.position + Vec2 { box.extent.x, -box.extent.y } - return { top_left, bottom_right } -} - -box_set_size :: proc( box : ^ Box2, size : AreaSize ) { - box.extent = transmute(Extents2) size * 0.5 -} - -// TODO(Ed) : Fix this up? -get_rl_rect :: proc( box : ^ Box2 ) -> rl.Rectangle { - rect : rl.Rectangle = { - x = box.position.x - box.extent.x, - y = box.position.y - box.extent.y, - width = box.extent.x * 2.0, - height = box.extent.y * 2.0, - } - return rect -}