image

This module defines the following constants:

Texture interpolation modes
  • BGUI_NEAREST
  • BGUI_LINEAR
class bgui.image.Image(parent, name, img, aspect=None, size=[0, 0], pos=[0, 0], texco=[(0, 0), (1, 0), (1, 1), (0, 1)], interp_mode=None, sub_theme='', options=12)

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
add_animation(animation)

Add the animation to the list of currently running animations

Parameters:animation – The animation
children

The widget’s children

color

The color of the plane the texture is on.

frozen

Whether or not the widget should accept events

interp_mode

The type of image filtering to be performed on the texture.

move(position, time, callback=None)

Move a widget to a new position over a number of frames

Parameters:
  • positon – The new position
  • time – The time in milliseconds to take doing the move
  • callback – An optional callback that is called when he animation is complete
name

The widget’s name

on_active

The widget’s on_active callback

on_click

The widget’s on_click callback

on_hover

The widget’s on_hover callback

on_mouse_enter

The widget’s on_mouse_enter callback

on_mouse_exit

The widget’s on_mouse_exit callback

on_release

The widget’s on_release callback

parent

The widget’s parent

position

The widget’s position

size

The widget’s size

system

A reference to the system object

update_image(img)

Changes the image texture

Parameters:img – the path to the new image
Return type:None
visible

Whether or not the widget is visible

z_index

The widget’s z-index. Widget’s with a higher z-index are drawn over those that have a lower z-index

Previous topic

frame_button

Next topic

image_button

This Page