qgym.utils.visualisation.typing module
This module contains types and type aliases used during visualisation.
- class qgym.utils.visualisation.typing.Font(file_path=None, size=12)
- class qgym.utils.visualisation.typing.Font(file_path, size) Font
- class qgym.utils.visualisation.typing.Font(pathlib.Path, size) Font
- class qgym.utils.visualisation.typing.Font(object, size) Font
Bases:
object
create a new Font object from a file
- bold
bold -> bool Gets or sets whether the font should be rendered in (faked) bold.
- italic
italic -> bool Gets or sets whether the font should be rendered in (faked) italics.
- size(text)
determine the amount of space needed to render text
- strikethrough
strikethrough -> bool Gets or sets whether the font should be rendered with a strikethrough.
- underline
underline -> bool Gets or sets whether the font should be rendered with an underline.
- class qgym.utils.visualisation.typing.Surface((width, height), flags=0, depth=0, masks=None)
- class qgym.utils.visualisation.typing.Surface((width, height), flags=0, Surface) Surface
Bases:
object
pygame object for representing images
- blit(source, dest, area=None, special_flags=0) Rect
draw one image onto another
- blits(blit_sequence=((source, dest), ...), doreturn=1) [Rect, ...] or None
- blits(((source, dest, area), ...)) [Rect, ...]
- blits(((source, dest, area, special_flags), ...)) [Rect, ...]
draw many images onto another
- convert(Surface=None) Surface
- convert(depth, flags=0) Surface
- convert(masks, flags=0) Surface
change the pixel format of an image
- convert_alpha(Surface) Surface
- convert_alpha() Surface
change the pixel format of an image including per pixel alphas
- fill(color, rect=None, special_flags=0) Rect
fill Surface with a solid color
- get_abs_offset()
find the absolute position of a child subsurface inside its top level parent
- get_alpha() int_value
get the current Surface transparency value
- get_at((x, y)) Color
get the color value at a single pixel
- get_at_mapped((x, y)) Color
get the mapped color value at a single pixel
- get_blendmode()
Return the surface’s SDL 2 blend mode
- get_bounding_rect(min_alpha=1) Rect
find the smallest rect containing data
- get_buffer() BufferProxy
acquires a buffer object for the pixels of the Surface.
- get_clip() Rect
get the current clipping area of the Surface
- get_colorkey() RGB or None
Get the current transparent colorkey
- get_height() height
get the height of the Surface
- get_losses()
the significant bits used to convert between a color and a mapped integer
- get_masks()
the bitmasks needed to convert between a color and a mapped integer
- get_offset()
find the position of a child subsurface inside a parent
- get_palette() [RGB, RGB, RGB, ...]
get the color index palette for an 8-bit Surface
- get_palette_at(index) RGB
get the color for a single entry in a palette
- get_rect(**kwargs) Rect
get the rectangular area of the Surface
- get_shifts()
the bit shifts needed to convert between a color and a mapped integer
- get_size()
get the dimensions of the Surface
- get_view(<kind>='2') BufferProxy
return a buffer view of the Surface’s pixels.
- get_width() width
get the width of the Surface
- map_rgb(Color) mapped_int
convert a color into a mapped color value
- premul_alpha() Surface
returns a copy of the surface with the RGB channels pre-multiplied by the alpha channel.
- set_alpha(value, flags=0) None
- set_alpha(None) None
set the alpha value for the full Surface image
- set_masks((r, g, b, a)) None
set the bitmasks needed to convert between a color and a mapped integer
- set_shifts((r, g, b, a)) None
sets the bit shifts needed to convert between a color and a mapped integer
- unmap_rgb(mapped_int) Color
convert a mapped integer color value into a Color