MCPcopy
hub / github.com/KilledByAPixel/LittleJS / isMouseOverlapping

Method isMouseOverlapping

plugins/uiSystem.js:816–824  ·  view source on GitHub ↗

Check if the mouse is overlapping this ui object * @return {boolean} - True if overlapping

()

Source from the content-addressed store, hash-verified

814 /** Check if the mouse is overlapping this ui object
815 * @return {boolean} - True if overlapping */
816 isMouseOverlapping()
817 {
818 if (!mouseInWindow) return false;
819
820 const size = !isTouchDevice ? this.size :
821 this.size.add(vec2(this.extraTouchSize || 0));
822 const pos = uiSystem.screenToNative(mousePosScreen);
823 return isOverlapping(this.pos, size, pos);
824 }
825
826 /** Update the object, called automatically by plugin once each frame */
827 update()

Callers 2

updateMethod · 0.95
updateMethod · 0.80

Calls 4

vec2Function · 0.85
isOverlappingFunction · 0.85
screenToNativeMethod · 0.80
addMethod · 0.45

Tested by

no test coverage detected