Skip to content

Commit 9d34992

Browse files
committed
making the base Control class take a rect makes most sense
1 parent f30ea9e commit 9d34992

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

UI/UIElement.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ class UIElement
55
children = [];
66
parent = null;
77
clickHandler = ()=>{};
8+
constructor(rekt)
9+
{
10+
this.hitbox= new Rectangle(rekt.x,rekt.y,rekt.width,rekt.height);
11+
}
812
update(dT)
913
{
1014
this.children.forEach((c)=>{

0 commit comments

Comments
 (0)