scripts.nqp.ui_elements package¶
Submodules¶
scripts.nqp.ui_elements.actor_info module¶
-
class
ActorInfo
(rect: pygame.Rect, manager: UIManager)[source]¶ Bases:
scripts.engine.widgets.window.Window
Full detail about an npc entity.
-
__init__
(rect: pygame.Rect, manager: UIManager)[source]¶ Initialize self. See help(type(self)) for accurate signature.
Process closure of a window. Must be overriden in subclass. Usual use is creation of an event.
Example
- def process_close_button(self):
- event = pygame.event.Event(EventType.GAME, subtype=GameEvent.EXIT_MENU,
menu=UIElement.ACTOR_INFO)
pygame.event.post(event)
-
scripts.nqp.ui_elements.blessing_menu module¶
Bases:
scripts.engine.widgets.window.Window
A menu for adding blessings.
Initialize self. See help(type(self)) for accurate signature.
Cleanse existing section info.
Process closure of a window. Must be overriden in subclass. Usual use is creation of an event.
Example
- def process_close_button(self):
- event = pygame.event.Event(EventType.GAME, subtype=GameEvent.EXIT_MENU,
menu=UIElement.ACTOR_INFO)
pygame.event.post(event)
fill in later
Update based on current state and data. Run every frame.
scripts.nqp.ui_elements.camera module¶
-
class
Camera
[source]¶ Bases:
object
Management class for rendering the world onto the main display surface.
-
property
end_x
¶
-
property
end_y
¶
-
get_render_pos
(pos: Tuple[float, float]) → Tuple[float, float][source]¶ Converts world position to render position (in pixels) by applying the camera’s position.
-
is_in_camera_view
(pos: Tuple[float, float]) → bool[source]¶ is the position inside the current camera view
-
property
on_target
¶
-
render
(target_surf: pygame.Surface)[source]¶
-
set_target
(pos: Tuple[float, float], recentre: bool = False)[source]¶ Set a new target position for the camera. If recentre is False (the default), the camera will only move if the target position goes past the loose area defined by Camera.move_edge_size. It will also only move until the target position is within the loose area in the center. If recentre is True, the camera will center perfectly over the target position.
-
property
scripts.nqp.ui_elements.character_selector module¶
-
class
CharacterSelector
(rect: pygame.Rect, manager: pygame_gui.ui_manager.UIManager)[source]¶ Bases:
scripts.engine.widgets.panel.Panel
A menu widget. Used to hold a collection of text, images, buttons etc. Expects to have buttons and provides functionality to handle the clicks
-
__init__
(rect: pygame.Rect, manager: pygame_gui.ui_manager.UIManager)[source]¶ Initialize self. See help(type(self)) for accurate signature.
-
scripts.nqp.ui_elements.dungen_viewer module¶
-
class
DungenViewer
(rect: pygame.Rect, manager: pygame_gui.ui_manager.UIManager)[source]¶ Bases:
scripts.engine.widgets.panel.Panel
UI component that renders the construction of a dungeon as a separate window, step by step.
-
__init__
(rect: pygame.Rect, manager: pygame_gui.ui_manager.UIManager)[source]¶ Initialize self. See help(type(self)) for accurate signature.
-
scripts.nqp.ui_elements.message_log module¶
-
class
MessageLog
(rect: Rect, manager: pygame_gui.ui_manager.UIManager)[source]¶ Bases:
scripts.engine.widgets.panel.Panel
Hold text relating to the game’s events, to display to the player. This should be a log of all notable things that have happened. It is recommended that all messages are in the past tense.
-
__init__
(rect: Rect, manager: pygame_gui.ui_manager.UIManager)[source]¶ Initialize self. See help(type(self)) for accurate signature.
-
add_message
(message: str)[source]¶ Add message to the message log. Formatting the text is done via a subset of HTML tags. Currently supported tags are: <b></b> or <strong></strong> - to encase bold styled text. <i></i>, <em></em> or <var></var> - to encase italic styled text. <u></u> - to encase underlined text. <a href=’id’></a> - to encase ‘link’ text that can be clicked on to generate events with the id given in href. <body bgcolor=’#FFFFFF’></body> - to change the background colour of encased text. <br> - to start a new line. <font face=’verdana’ color=’#000000’ size=3.5></font> - To set the font, colour and size of encased text.
-
scripts.nqp.ui_elements.skill_bar module¶
-
class
SkillBar
(rect: pygame.Rect, manager: pygame_gui.ui_manager.UIManager)[source]¶ Bases:
scripts.engine.widgets.panel.Panel
Display and hold the info for the skills in the skill bar.
-
__init__
(rect: pygame.Rect, manager: pygame_gui.ui_manager.UIManager)[source]¶ Initialize self. See help(type(self)) for accurate signature.
-
scripts.nqp.ui_elements.tile_info module¶
-
class
TileInfo
(rect: pygame.Rect, manager: pygame_gui.ui_manager.UIManager)[source]¶ Bases:
scripts.engine.widgets.panel.Panel
Hold text relating to the game’s events, to display to the player.
-
__init__
(rect: pygame.Rect, manager: pygame_gui.ui_manager.UIManager)[source]¶ Initialize self. See help(type(self)) for accurate signature.
-
scripts.nqp.ui_elements.title_screen module¶
-
class
TitleScreen
(rect: Rect, manager: UIManager)[source]¶ Bases:
scripts.engine.widgets.panel.Panel
Initial screen menu