panda3d.core.MouseWatcherRegion

from panda3d.core import MouseWatcherRegion
class MouseWatcherRegion

Bases: TypedWritableReferenceCount, Namable

This is the class that defines a rectangular region on the screen for the MouseWatcher.

Inheritance diagram

Inheritance diagram of MouseWatcherRegion

__init__(param0: MouseWatcherRegion) → None
__init__(name: str, frame: LVecBase4) → None
__init__(name: str, left: float, right: float, bottom: float, top: float) → None
setFrame(frame: LVecBase4) → None
setFrame(left: float, right: float, bottom: float, top: float) → None
getFrame() → LVecBase4
Return type

LVecBase4

getArea() → float

Returns the area of the rectangular region.

setSort(sort: int) → None

Changes the sorting order of this particular region. The sorting order is used to resolve conflicts in the case of overlapping region; the region with the highest sort value will be preferred, and between regions of the same sort value, the smallest region will be preferred. The default sorting order, if none is explicitly specified, is 0.

getSort() → int

Returns the current sorting order of this region. See setSort().

setActive(active: bool) → None

Sets whether the region is active or not. If it is not active, the MouseWatcher will never consider the mouse to be over the region. The region might still receive keypress events if its setKeyboard() flag is true.

getActive() → bool

Returns whether the region is active or not. See setActive().

setKeyboard(keyboard: bool) → None

Sets whether the region is interested in global keyboard events. If this is true, then any keyboard button events will be passed to press() and release() regardless of the position of the mouse onscreen; otherwise, these events will only be passed if the mouse is over the region.

getKeyboard() → bool

Returns whether the region is interested in global keyboard events; see setKeyboard().

setSuppressFlags(suppress_flags: int) → None

Sets which events are suppressed when the mouse is over the region. This is the union of zero or more various SF_* values. Normally, this is 0, indicating that no events are suppressed.

If you set this to a non-zero value, for instance SF_mouse_position, then the mouse position will not be sent along the data graph when the mouse is over this particular region.

getSuppressFlags() → int

Returns the current suppress_flags. See setSuppressFlags().

output(out: ostream) → None
write(out: ostream, indent_level: int) → None
static getClassType() → TypeHandle
Return type

TypeHandle

property frame

Getter Setter

Return type

LVecBase4

property area

Returns the area of the rectangular region.

Return type

float

property sort
Getter

Returns the current sorting order of this region. See setSort().

Setter

Changes the sorting order of this particular region. The sorting order is used to resolve conflicts in the case of overlapping region; the region with the highest sort value will be preferred, and between regions of the same sort value, the smallest region will be preferred. The default sorting order, if none is explicitly specified, is 0.

Return type

int

property active
Getter

Returns whether the region is active or not. See setActive().

Setter

Sets whether the region is active or not. If it is not active, the MouseWatcher will never consider the mouse to be over the region. The region might still receive keypress events if its setKeyboard() flag is true.

Return type

bool

property keyboard
Getter

Returns whether the region is interested in global keyboard events; see setKeyboard().

Setter

Sets whether the region is interested in global keyboard events. If this is true, then any keyboard button events will be passed to press() and release() regardless of the position of the mouse onscreen; otherwise, these events will only be passed if the mouse is over the region.

Return type

bool

property suppress_flags
Getter

Returns the current suppress_flags. See setSuppressFlags().

Setter

Sets which events are suppressed when the mouse is over the region. This is the union of zero or more various SF_* values. Normally, this is 0, indicating that no events are suppressed.

If you set this to a non-zero value, for instance SF_mouse_position, then the mouse position will not be sent along the data graph when the mouse is over this particular region.

Return type

int

enum SuppressFlags
enumerator SF_mouse_button = 1
enumerator SF_other_button = 2
enumerator SF_any_button = 3
enumerator SF_mouse_position = 4