peng3d.util.types
- Custom Types¶
This module contains various helper types used throughout peng3d
.
Most of these types are aliases, which ensure compatibility with existing applications that for example pass in literal values (which wouldn’t be of a custom type without casting).
-
peng3d.util.types.
ColorRGB
= typing.List[int]¶ RGB Color represented as three integers from zero to 255.
-
peng3d.util.types.
ColorRGBA
= typing.List[int]¶ RGBA Color represented as four integers from zero to 255.
-
peng3d.util.types.
ColorRGBFloat
= typing.List[float]¶ RGB Color represented as three floats from zero to one.
-
peng3d.util.types.
ColorRGBAFloat
= typing.List[float]¶ RGBA Color represented as four floats from zero to one.
-
peng3d.util.types.
BorderStyle
= typing.Union[typing.Type[ForwardRef('Borderstyle')], str]¶ Border style identifier.
Either a subclass of
Borderstyle()
or a string identifier.
-
peng3d.util.types.
BackgroundType
= typing.Union[ForwardRef('Layer'), typing.Callable, list, tuple, ForwardRef('Background'), str, typing.Type[ForwardRef('DEFER_BG')]]¶ Type encompassing all allowed types for backgrounds of menus and submenus.
See also
See
setBackground()
for further details.
-
peng3d.util.types.
DynPosition
= typing.Union[typing.List[float], typing.Callable[[float, float, float, float], typing.Tuple[float, float]], ForwardRef('layout.LayoutCell')]¶ Dynamic position of a widget or container.
Can be either a static position as a list, a callback function or a
LayoutCell
.
-
peng3d.util.types.
DynSize
= typing.Union[typing.List[float], typing.Callable[[float, float], typing.Tuple[float, float]], NoneType]¶ Dynamic size of a widget or container.
Can be either a static size as a list or a callback function. May be
None
if the position is aLayoutCell
.
-
peng3d.util.types.
DynTranslateable
= typing.Union[str, ForwardRef('_LazyTranslator')]¶ A string that may be either fixed, translated or even dynamically translated.
If a method or class accepts this type, it means that it supports dynamic translation of this attribute, unless indicated otherwise in its documentation.