Skip to content

Commit

Permalink
Docs fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
MyreMylar committed Apr 14, 2024
1 parent 7c83ef8 commit de1db45
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 21 deletions.
2 changes: 1 addition & 1 deletion docs/source/events.rst
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ clicked on by a user.
print("Window moved to front")
:class:`UIWindow <pygame_gui.elements.UIWindow>` - UI_WINDOW_RESIZED
..................................................................
....................................................................

Fired when a window is resized.

Expand Down
20 changes: 10 additions & 10 deletions pygame_gui/core/interfaces/text_owner_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from pygame_gui._constants import UITextEffectType

if TYPE_CHECKING:
from pygame_gui.core.drawable_shapes.drawable_shape import TextLineChunkFTFont
import pygame_gui.core.text.text_line_chunk


class IUITextOwnerInterface(metaclass=ABCMeta):
Expand All @@ -14,7 +14,7 @@ class IUITextOwnerInterface(metaclass=ABCMeta):
"""

@abstractmethod
def set_text_alpha(self, alpha: int, sub_chunk: Optional['TextLineChunkFTFont'] = None):
def set_text_alpha(self, alpha: int, sub_chunk: Optional['pygame_gui.core.text.text_line_chunk.TextLineChunkFTFont'] = None):
"""
Set the global alpha value for the text
Expand All @@ -24,7 +24,7 @@ def set_text_alpha(self, alpha: int, sub_chunk: Optional['TextLineChunkFTFont']

@abstractmethod
def set_text_offset_pos(self, offset: Tuple[int, int],
sub_chunk: Optional['TextLineChunkFTFont'] = None):
sub_chunk: Optional['pygame_gui.core.text.text_line_chunk.TextLineChunkFTFont'] = None):
"""
Move the text around by this offset.
Expand All @@ -35,7 +35,7 @@ def set_text_offset_pos(self, offset: Tuple[int, int],

@abstractmethod
def set_text_rotation(self, rotation: int,
sub_chunk: Optional['TextLineChunkFTFont'] = None):
sub_chunk: Optional['pygame_gui.core.text.text_line_chunk.TextLineChunkFTFont'] = None):
"""
rotate the text by this int in degrees
Expand All @@ -45,7 +45,7 @@ def set_text_rotation(self, rotation: int,
"""

@abstractmethod
def set_text_scale(self, scale: float, sub_chunk: Optional['TextLineChunkFTFont'] = None):
def set_text_scale(self, scale: float, sub_chunk: Optional['pygame_gui.core.text.text_line_chunk.TextLineChunkFTFont'] = None):
"""
Scale the text by this float
Expand All @@ -55,15 +55,15 @@ def set_text_scale(self, scale: float, sub_chunk: Optional['TextLineChunkFTFont
"""

@abstractmethod
def clear_text_surface(self, sub_chunk: Optional['TextLineChunkFTFont'] = None):
def clear_text_surface(self, sub_chunk: Optional['pygame_gui.core.text.text_line_chunk.TextLineChunkFTFont'] = None):
"""
Clear the text surface
:param sub_chunk: An optional chunk so we only clear the surface for this chunk.
"""

@abstractmethod
def get_text_letter_count(self, sub_chunk: Optional['TextLineChunkFTFont'] = None) -> int:
def get_text_letter_count(self, sub_chunk: Optional['pygame_gui.core.text.text_line_chunk.TextLineChunkFTFont'] = None) -> int:
"""
The amount of letters in the text
Expand All @@ -72,7 +72,7 @@ def get_text_letter_count(self, sub_chunk: Optional['TextLineChunkFTFont'] = Non
:return: number of letters as an int
"""
@abstractmethod
def update_text_end_position(self, end_pos: int, sub_chunk: Optional['TextLineChunkFTFont'] = None):
def update_text_end_position(self, end_pos: int, sub_chunk: Optional['pygame_gui.core.text.text_line_chunk.TextLineChunkFTFont'] = None):
"""
The position in the text to render up to.
Expand Down Expand Up @@ -120,7 +120,7 @@ def get_object_id(self) -> str:
"""

@abstractmethod
def stop_finished_effect(self, sub_chunk: Optional['TextLineChunkFTFont'] = None):
def stop_finished_effect(self, sub_chunk: Optional['pygame_gui.core.text.text_line_chunk.TextLineChunkFTFont'] = None):
"""
Stops a finished effect. Will leave effected text in the state it was in when effect
ended. Used when an effect reaches a natural end where we might want to keep it in
Expand All @@ -130,7 +130,7 @@ def stop_finished_effect(self, sub_chunk: Optional['TextLineChunkFTFont'] = None
"""

@abstractmethod
def clear_all_active_effects(self, sub_chunk: Optional['TextLineChunkFTFont'] = None):
def clear_all_active_effects(self, sub_chunk: Optional['pygame_gui.core.text.text_line_chunk.TextLineChunkFTFont'] = None):
"""
Clears any active effects and redraws the text. A full reset, usually called before
firing off a new effect if one is already in progress.
Expand Down
19 changes: 9 additions & 10 deletions pygame_gui/elements/ui_text_box.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,33 +68,32 @@ class UITextBox(UIElement, IUITextOwnerInterface):
final dimension to whatever the text rendering produces. This lets us make dynamically sized
text boxes depending on their contents.
:param html_text: The HTML formatted text to display in this text box.
:param relative_rect: The 'visible area' rectangle, positioned relative to its container.
:param manager: The UIManager that manages this element. If not provided or set to None,
it will try to use the first UIManager that was created by your application.
:param wrap_to_height: False by default, if set to True the box will increase in height to
match the text within.
:param starting_height: Sets the height, above its container, to start placing the text
box at.
box at.
:param container: The container that this element is within. If not provided or set to None
will be the root window's container.
:param parent_element: The element this element 'belongs to' in the theming hierarchy.
:param object_id: A custom defined ID for fine-tuning of theming.
:param anchors: A dictionary describing what this element's relative_rect is relative to.
:param visible: Whether the element is visible by default. Warning - container visibility
may override this.
:param pre_parsing_enabled: when enabled will replace all '\n' characters with html <br> tags.
:param text_kwargs: a dictionary of variable arguments to pass to the translated text
:param pre_parsing_enabled: When enabled will replace all newline characters with html <br> tags.
:param text_kwargs: A dictionary of variable arguments to pass to the translated text
useful when you have multiple translations that need variables inserted
in the middle.
:param allow_split_dashes: sets whether long words that don't fit on a single line will be split with a dash
:param allow_split_dashes: Sets whether long words that don't fit on a single line will be split with a dash
or just split without a dash (more compact).
:param plain_text_display_only: no markup based styling & formatting will be done on the input text.
:param should_html_unescape_input_text: when enabled turns plain text encoded html back into html for
this text box. e.g. &lt; will become <
:param placeholder_text: If the text line is empty, and not focused, this placeholder text will be
shown instead.
:param plain_text_display_only: No markup based styling & formatting will be done on the input text.
:param should_html_unescape_input_text: When enabled turns plain text encoded html back into html for this text box.
e.g. &lt; will become '<'
:param placeholder_text: If the text line is empty, and not focused, this placeholder text will be shown instead.
"""

def __init__(self,
Expand Down

0 comments on commit de1db45

Please sign in to comment.