MouseWatcherBase
from panda3d.core import MouseWatcherBase
- class MouseWatcherBase
Bases:
This represents a collection of
MouseWatcherRegions
that may be managed as a group. This is the base class for bothMouseWatcherGroup
andMouseWatcher
, and exists so that we don’t have to makeMouseWatcher
inherit fromReferenceCount
more than once.Inheritance diagram
- add_region(region: MouseWatcherRegion)
Adds the indicated region to the set of regions in the group. It is no longer an error to call this for the same region more than once.
- clear_regions()
Removes all the regions from the group.
- find_region(name: str) MouseWatcherRegion
Returns a pointer to the first region found with the indicated name. If multiple regions share the same name, the one that is returned is indeterminate.
- static get_class_type() TypeHandle
- get_region(n: int) MouseWatcherRegion
Returns the nth region of the group; returns NULL if there is no nth region. Note that this is not thread-safe; another thread might have removed the nth region before you called this method.
- has_region(region: MouseWatcherRegion) bool
Returns true if the indicated region has already been added to the
MouseWatcherBase
, false otherwise.
- hide_regions()
Stops the visualization created by a previous call to
show_regions()
.
- property regions Sequence[MouseWatcherRegion]
Returns the nth region of the group; returns NULL if there is no nth region. Note that this is not thread-safe; another thread might have removed the nth region before you called this method.
- remove_region(region: MouseWatcherRegion) bool
Removes the indicated region from the group. Returns true if it was successfully removed, or false if it wasn’t there in the first place.
- set_color(color: LColor)
Specifies the color used to draw the region rectangles for the regions visualized by
show_regions()
.
- show_regions(render2d: NodePath, bin_name: str, draw_order: int)
Enables the visualization of all of the regions handled by this
MouseWatcherBase
. The suppliedNodePath
should be the root of the 2-d scene graph for the window.
- sort_regions()
Sorts all the regions in this group into pointer order.
- update_regions()
Refreshes the visualization created by
show_regions()
.