emeraldengine 2.0.0 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -16,8 +16,6 @@ class EventManager {
|
|
|
16
16
|
this.keyDownListeners = new Map();
|
|
17
17
|
this.keyUpListeners = new Map();
|
|
18
18
|
this.clickListeners = new Map();
|
|
19
|
-
this.canvasWidth = canvas.width;
|
|
20
|
-
this.canvasHeight = canvas.height;
|
|
21
19
|
this.hoverListeners = new Map();
|
|
22
20
|
this.lastHoveredObject = null;
|
|
23
21
|
this.lastHoveredInstance = null;
|
|
@@ -187,9 +185,9 @@ class EventManager {
|
|
|
187
185
|
|
|
188
186
|
// Convert to world coordinates
|
|
189
187
|
const worldX =
|
|
190
|
-
canvasX - this.
|
|
188
|
+
canvasX - this.canvas.width / 2 - this.camera.transform.position.x;
|
|
191
189
|
const worldY =
|
|
192
|
-
this.
|
|
190
|
+
this.canvas.height / 2 - canvasY - this.camera.transform.position.y;
|
|
193
191
|
|
|
194
192
|
this.scene.objects.forEach((sceneObject) => {
|
|
195
193
|
if (!sceneObject.isActive) return; // Skip inactive objects
|
|
@@ -326,9 +324,9 @@ class EventManager {
|
|
|
326
324
|
|
|
327
325
|
// Convert to world coordinates
|
|
328
326
|
const worldX =
|
|
329
|
-
canvasX - this.
|
|
327
|
+
canvasX - this.canvas.width / 2 - this.camera.transform.position.x;
|
|
330
328
|
const worldY =
|
|
331
|
-
this.
|
|
329
|
+
this.canvas.height / 2 - canvasY - this.camera.transform.position.y;
|
|
332
330
|
this.mousePosition.x = worldX;
|
|
333
331
|
this.mousePosition.y = worldY;
|
|
334
332
|
let hoveredObject = null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "emeraldengine",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.2",
|
|
4
4
|
"description": "2D graphics library for Web",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
|
@@ -34,5 +34,9 @@
|
|
|
34
34
|
},
|
|
35
35
|
"author": "vahan-gev",
|
|
36
36
|
"license": "MIT",
|
|
37
|
+
"repository": {
|
|
38
|
+
"type": "git",
|
|
39
|
+
"url": "git+https://github.com/vahan-gev/emeraldengine.git"
|
|
40
|
+
},
|
|
37
41
|
"devDependencies": {}
|
|
38
42
|
}
|