MCPcopy Create free account
hub / github.com/SolarLune/masterplan / ClickedInRect

Function ClickedInRect

utils.go:241–246  ·  view source on GitHub ↗
(rect *sdl.FRect, worldSpace bool)

Source from the content-addressed store, hash-verified

239}
240
241func ClickedInRect(rect *sdl.FRect, worldSpace bool) bool {
242 if worldSpace && !globals.Mouse.OverGUI {
243 return globals.Mouse.Button(sdl.BUTTON_LEFT).Pressed() && globals.Mouse.WorldPosition().Inside(rect)
244 }
245 return globals.Mouse.Button(sdl.BUTTON_LEFT).Pressed() && globals.Mouse.Position().Inside(rect)
246}
247
248func RawClickedInRect(rect *sdl.FRect, worldSpace bool) bool {
249 if worldSpace && !globals.Mouse.OverGUI {

Callers 6

UpdateMethod · 0.85
UpdateMethod · 0.85
GlobalShortcutsMethod · 0.85
UpdateMethod · 0.85
UpdateMethod · 0.85
UpdateMethod · 0.85

Calls 5

ButtonMethod · 0.80
InsideMethod · 0.80
WorldPositionMethod · 0.80
PressedMethod · 0.45
PositionMethod · 0.45

Tested by

no test coverage detected