CactusGUI element for drawing images to the screen
someImageToDisplay = pygame.image.load('something/something/myImageHere.jpg')
gui.makeImage('myImage')
gui['myImage'].style(owner='main', image=someImageToDisplay, top=50, left=50, resize=True, height=200, width=200)
Attribute | Datatype | Comments |
---|---|---|
image | pygame.Surface | |
height | int | |
width | int | |
resize | bool |
Changes the size that the image is displayed as, the new size is based on height and width. Note: resizing 1x1 images can cause segmentation faults. |
position | string | Changes how the rendering uses the positioning attributes. Possible values are 'absolute' | 'point' | 'mouse'. Defaults to 'absolute' |
top | int | |
bottom | int | |
centery | int | |
left | int | |
right | int | |
centerx | int | |
point | string | Name of a point element |
image_offset_left | int | |
image_offset_top | int | |
color_overlay | color (R,G,B) | |
opacity | int | 0 to 255 |
has_pixel_alpha | bool | |
angle | int |
0 to 359 |
clip_image | bool | |
pivotx | int | |
pivoty | int | |
image_surface | pygame.Surface |
Attribute | Datatype | Comments |
---|---|---|
name | string | Identifies the element inside the GUI |
owner | string | Name of the element that "owns" the current element |
type | string | The specific kind of element - ex: Textbox, Button, Image, State, etc. |
z_order | int | Determines the layering order of the element when GUI elements with the same owner are rendered. The element with the highest z-order is layered on top. Can use both positive and negative numbers. |
visible | bool | If visible is True then the element is displayed, if False then the element will not display. Child-elements that the element owns will still be rendered. Defaults to True. |
show | bool | If False then the element's child-elements will not be rendered to the screen. Defaults to True. |
use_hover | bool |
Defaults to True for some elements.
Tells the GUI's listener object to listen for events from the current element: onHover, onUnhover |
use_click | bool |
Defaults to True for some elements.
Tells the GUI's listener object to listen for events from the current element: onMousedown, onRightMousedown, onAnyMousedown, onMouseup, onRightMouseup, onAnyMouseup, onClick, onRightClick, onAnyClick, onBlur, onDeactivate onActivate requires both use_click and use_active onFocus requires both use_click and use_focus |
use_scroll | bool |
Defaults to True for some elements.
Tells the GUI's listener object to listen for events from the current element: onCenterMousedown, onCenterMouseup, onScrollUp, onScrollDown |
use_active | bool |
Defaults to True for some elements. onActivate requires both use_click and use_active |
use_focus | bool |
Defaults to True for some elements. onFocus requires both use_click and use_focus |