Conversation
src/ecs/components/physics/area.ts
Outdated
|
|
||
| system("hover", () => { | ||
| if (_k.game.fakeMouse) { | ||
| mouseHover(toWorld(_k.game.fakeMouse.pos)); |
There was a problem hiding this comment.
Shouldn't this be fakeMouseHover or is it intentionally wrong
Also, return if fake mouse exists?
There was a problem hiding this comment.
Can't you use fakeMouse and Mouse together?
There was a problem hiding this comment.
They have their own closure because I thought they can be used simultaneously.
There was a problem hiding this comment.
Idk, I think the intention was that if the game used fake mouse then the fake mouse object will move to always follow the real mouse, so the hover handler should not run twice in that case.
Also, the hover handler is given the world position, and toWorld converts from screen space to world space, but the fakeMouse.pos is already world space right? At least it won't be screen space if the camera transform is not the identity
There was a problem hiding this comment.
update(this: FakeMouse) {
if (this.pos.x !== lastPos.x || this.pos.y !== lastPos.y) {
this.trigger("fakeMouseMove", this.pos.clone()); // TODO: Create a deltaPos
}It doesn't pass world coordinates to its trigger, so if it is not in root, it's not working as expected.
There was a problem hiding this comment.
The fakeMouseMove event is new, not surprising that it's wrong in places, but also good cause it's unlikely someone is using this extremely unfinished branch just for that event
There was a problem hiding this comment.
It's not in this branch, it's been there since fakemouse.
There was a problem hiding this comment.
It's not in this branch, it's been there since fakemouse.
commit: |
Please describe what issue(s) this PR fixes.
Summary