image¶
This module defines the following constants:
- Texture interpolation modes
- BGUI_NEAREST
- BGUI_LINEAR
-
class
bgui.image.
Image
(parent, img, name=None, aspect=None, size=[1, 1], pos=[0, 0], texco=[(0, 0), (1, 0), (1, 1), (0, 1)], interp_mode=<class 'GL_LINEAR'>, sub_theme='', options=0)¶ Bases:
bgui.widget.Widget
Widget for displaying images
Parameters: - parent – the widget’s parent
- name – the name of the widget
- img – the image to use for the widget
- aspect – constrain the widget size to a specified aspect ratio
- size – a tuple containing the width and height
- pos – a tuple containing the x and y position
- texco – the UV texture coordinates to use for the image
- interp_mode – texture interpolating mode for both maximizing and minifying the texture (defaults to BGUI_LINEAR)
- sub_theme – name of a sub_theme defined in the theme file (similar to CSS classes)
- options – various other options
-
texco
= None¶ The UV texture coordinates to use for the image.
-
color
= None¶ The color of the plane the texture is on.
-
interp_mode
¶ The type of image filtering to be performed on the texture.
-
image_size
¶ The size (in pixels) of the currently loaded image, or [0, 0] if an image is not loaded
-
update_image
(img)¶ Changes the image texture
Parameters: img – the path to the new image Return type: None