func (hb *HitboxImpl) MouseMove(position mgl32.Vec2) { if util.PointLiesInsideAABB(mgl32.Vec2{}, hb.size, position) { if !hb.hoverState { hb.hoverState = true hb.eventHandler.onHover() } hb.eventHandler.onMouseMove(position) } else if hb.hoverState { hb.hoverState = false hb.eventHandler.onUnHover() } }
func (hb *HitboxImpl) MouseClick(button int, release bool, position mgl32.Vec2) { if util.PointLiesInsideAABB(mgl32.Vec2{}, hb.size, position) { hb.eventHandler.onClick(button, release, position) } }