Back to index

unity  6.0.0
Public Member Functions | Public Attributes
unity.emulators.hud.Hud Class Reference
Inheritance diagram for unity.emulators.hud.Hud:
Inheritance graph
[legend]
Collaboration diagram for unity.emulators.hud.Hud:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def ensure_hidden
def ensure_visible
def toggle_reveal
def get_embedded_icon
def get_launcher_icon
def icon
def view
def visible
def searchbar
def search_string
def is_locked_launcher
def monitor
def geometry
def selected_button
def hud_buttons
def selected_hud_button
def num_buttons

Public Attributes

 controller
 keyboard

Detailed Description

An emulator class that makes it easier to iteract with unity hud.

Definition at line 22 of file hud.py.


Constructor & Destructor Documentation

Definition at line 25 of file hud.py.

00025 
00026     def __init__(self):
00027         super (Hud, self).__init__()
00028         controllers = HudController.get_all_instances()
00029         assert(len(controllers) == 1)
00030         self.controller = controllers[0]
00031         self.keyboard = Keyboard()


Member Function Documentation

Hides the hud if it's not already hidden.

Definition at line 32 of file hud.py.

00032 
00033     def ensure_hidden(self):
00034         """Hides the hud if it's not already hidden."""
00035         if self.visible:
00036             self.keyboard.press_and_release("Escape")
00037             self.visible.wait_for(False)

Here is the call graph for this function:

Shows the hud if it's not already showing.

Definition at line 38 of file hud.py.

00038 
00039     def ensure_visible(self):
00040         """Shows the hud if it's not already showing."""
00041         if not self.visible:
00042             self.toggle_reveal()
00043             self.visible.wait_for(True)

Here is the call graph for this function:

Definition at line 101 of file hud.py.

00101 
00102     def geometry(self):
00103         return (self.controller.x, self.controller.y, self.controller.width, self.controller.height)

Here is the caller graph for this function:

Returns the HUD view embedded icon or None if is not shown.

Definition at line 50 of file hud.py.

00050 
00051     def get_embedded_icon(self):
00052         """Returns the HUD view embedded icon or None if is not shown."""
00053         view = self.view
00054         if (not view):
00055           return None
00056 
00057         icons = view.get_children_by_type(HudEmbeddedIcon)
00058         return icons[0] if icons else None

Here is the call graph for this function:

Here is the caller graph for this function:

Returns the HUD launcher icon

Definition at line 59 of file hud.py.

00059 
00060     def get_launcher_icon(self):
00061         """Returns the HUD launcher icon"""
00062         icons = HudLauncherIcon.get_all_instances()
00063         assert(len(icons) == 1)
00064         return icons[0]

Here is the caller graph for this function:

Returns a list of current HUD buttons.

Definition at line 113 of file hud.py.

00113 
00114     def hud_buttons(self):
00115         """Returns a list of current HUD buttons."""
00116         return self.view.hud_buttons

Here is the caller graph for this function:

Definition at line 66 of file hud.py.

00066 
00067     def icon(self):
00068         if self.is_locked_launcher:
00069             return self.get_launcher_icon()
00070         else:
00071             return self.get_embedded_icon()

Here is the call graph for this function:

Definition at line 93 of file hud.py.

00093 
00094     def is_locked_launcher(self):
00095         return self.controller.locked_to_launcher

Here is the caller graph for this function:

Definition at line 97 of file hud.py.

00097 
00098     def monitor(self):
00099         return self.controller.hud_monitor

Here is the caller graph for this function:

Definition at line 126 of file hud.py.

00126 
00127     def num_buttons(self):
00128         view = self.controller.get_hud_view()
00129         if view:
00130             return view.num_buttons
00131         else:
00132             return 0
00133 

Returns the searchbars' search string.

Definition at line 88 of file hud.py.

00088 
00089     def search_string(self):
00090         """Returns the searchbars' search string."""
00091         return self.searchbar.search_string

Returns the searchbar attached to the hud.

Definition at line 83 of file hud.py.

00083 
00084     def searchbar(self):
00085         """Returns the searchbar attached to the hud."""
00086         return self.controller.get_hud_view().searchbar

Definition at line 105 of file hud.py.

00105 
00106     def selected_button(self):
00107         view = self.controller.get_hud_view()
00108         if view:
00109             return view.selected_button
00110         else:
00111             return 0

Definition at line 118 of file hud.py.

00118 
00119     def selected_hud_button(self):
00120         try:
00121             [button] = filter(lambda x: x.focused, self.hud_buttons)
00122             return button
00123         except IndexError:
00124             raise RuntimeError("No HUD buttons found, is hud active?")

Here is the call graph for this function:

def unity.emulators.hud.Hud.toggle_reveal (   self,
  tap_delay = 0.1 
)
Tap the 'Alt' key to toggle the hud visibility.

Definition at line 44 of file hud.py.

00044 
00045     def toggle_reveal(self, tap_delay=0.1):
00046         """Tap the 'Alt' key to toggle the hud visibility."""
00047         old_state = self.visible
00048         self.keybinding("hud/reveal", tap_delay)
00049         self.visible.wait_for(not old_state)

Here is the call graph for this function:

Here is the caller graph for this function:

Returns the HudView.

Definition at line 73 of file hud.py.

00073 
00074     def view(self):
00075         """Returns the HudView."""
00076         return self.controller.get_hud_view()

Here is the caller graph for this function:

Is the Hud visible?

Definition at line 78 of file hud.py.

00078 
00079     def visible(self):
00080         """Is the Hud visible?"""
00081         return self.controller.visible

Here is the caller graph for this function:


Member Data Documentation

Definition at line 29 of file hud.py.

Definition at line 30 of file hud.py.


The documentation for this class was generated from the following file: