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.

cleanse()[source]

Cleanse existing section info.

process_close_button()[source]

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)

set_entity(entity: int)[source]

Set the selected entity to show the info for that entity.

show()[source]

Show the entity info. Builds the sections required, after clearing any existing.

update(time_delta: float)[source]

Update based on current state and data. Run every frame.

scripts.nqp.ui_elements.blessing_menu module

class BlessingMenu(rect: pygame.Rect, manager: UIManager, blessings: List[SkillModifier])[source]

Bases: scripts.engine.widgets.window.Window

A menu for adding blessings.

__init__(rect: pygame.Rect, manager: UIManager, blessings: List[SkillModifier])[source]

Initialize self. See help(type(self)) for accurate signature.

cleanse()[source]

Cleanse existing section info.

process_close_button()[source]

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)

show()[source]

fill in later

update(time_delta: float)[source]

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.

__init__()[source]

Initialize self. See help(type(self)) for accurate signature.

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.

update(time_delta: float)[source]

Apply logical updates to camera.

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.

process_event(event)[source]

Gives UI Windows access to pygame events. Derived windows should super() call this class if they implement their own process_event method.

update(time_delta: float)[source]

Update based on current state and data. Run every frame.

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.

refresh_viewer()[source]

Gets the data for the viewer and runs generation again.

update(time_delta: float)[source]

Update based on current state and data. Run every frame.

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.

process_event(event: pygame.event.Event)[source]

Gives UI Windows access to pygame events. Derived windows should super() call this class if they implement their own process_event method.

refresh_skills()[source]

Reload the player skills and assign the correct images. All buttons set to blank if player doesnt exist.

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.

cleanse()[source]

Cleanse existing section info.

set_selected_tile_pos(tile_pos: Tuple[int, int])[source]

Set the selected tile position to show the info for that tile.

show()[source]

Show the tile info. Builds the sections required, after clearing any existing. Also triggers base class show method.

scripts.nqp.ui_elements.title_screen module

class TitleScreen(rect: Rect, manager: UIManager)[source]

Bases: scripts.engine.widgets.panel.Panel

Initial screen menu

__init__(rect: Rect, manager: UIManager)[source]

Initialize self. See help(type(self)) for accurate signature.

process_event(event)[source]

Gives UI Windows access to pygame events. Derived windows should super() call this class if they implement their own process_event method.

Module contents