Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct pygame.display stubs #3264

Merged
merged 5 commits into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions buildconfig/stubs/pygame/display.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,16 @@ def set_mode(
display: int = 0,
vsync: int = 0,
) -> Surface: ...
def get_surface() -> Surface: ...
def get_surface() -> Optional[Surface]: ...
aatle marked this conversation as resolved.
Show resolved Hide resolved
def flip() -> None: ...
@overload
def update() -> None: ...
@overload
def update(
rectangle: Optional[Union[RectLike, Iterable[Optional[RectLike]]]] = None, /
rectangle: Optional[Union[RectLike, Iterable[Optional[RectLike]]]], /
) -> None: ...
@overload
def update(x: int, y: int, w: int, h: int, /) -> None: ...
def update(x: float, y: float, w: float, h: float, /) -> None: ...
@overload
def update(xy: Point, wh: Point, /) -> None: ...
def get_driver() -> str: ...
Expand Down
6 changes: 5 additions & 1 deletion docs/reST/ref/display.rst
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ required).

| :sl:`Get a reference to the currently set display surface`
| :sg:`get_surface() -> Surface`
| :sg:`get_surface() -> None`

Return a reference to the currently set display Surface. If no display mode
has been set this will return None.
Expand All @@ -272,7 +273,10 @@ required).
.. function:: update

| :sl:`Update all, or a portion, of the display. For non-OpenGL displays.`
| :sg:`update(rectangle=None, /) -> None`
| :sg:`update() -> None`
| :sg:`update(rectangle, /) -> None`
| :sg:`update(x, y, w, h, /) -> None`
| :sg:`update((x, y), (w, h), /) -> None`
| :sg:`update(rectangle_iterable, /) -> None`

For non OpenGL display Surfaces, this function is very similar to
Expand Down
4 changes: 2 additions & 2 deletions src_c/doc/display_doc.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
#define DOC_DISPLAY_QUIT "quit() -> None\nUninitialize the display module"
#define DOC_DISPLAY_GETINIT "get_init() -> bool\nReturns True if the display module has been initialized"
#define DOC_DISPLAY_SETMODE "set_mode(size=(0, 0), flags=0, depth=0, display=0, vsync=0) -> Surface\nInitialize a window or screen for display"
#define DOC_DISPLAY_GETSURFACE "get_surface() -> Surface\nGet a reference to the currently set display surface"
#define DOC_DISPLAY_GETSURFACE "get_surface() -> Surface\nget_surface() -> None\nGet a reference to the currently set display surface"
#define DOC_DISPLAY_FLIP "flip() -> None\nUpdate the full display Surface to the screen"
#define DOC_DISPLAY_UPDATE "update(rectangle=None, /) -> None\nupdate(rectangle_iterable, /) -> None\nUpdate all, or a portion, of the display. For non-OpenGL displays."
#define DOC_DISPLAY_UPDATE "update() -> None\nupdate(rectangle, /) -> None\nupdate(x, y, w, h, /) -> None\nupdate((x, y), (w, h), /) -> None\nupdate(rectangle_iterable, /) -> None\nUpdate all, or a portion, of the display. For non-OpenGL displays."
#define DOC_DISPLAY_GETDRIVER "get_driver() -> name\nGet the name of the pygame display backend"
#define DOC_DISPLAY_INFO "Info() -> VideoInfo\nCreate a video display information object"
#define DOC_DISPLAY_GETWMINFO "get_wm_info() -> dict\nGet information about the current windowing system"
Expand Down
Loading