Function |
Explanation |
Arguments |
draw() | Draws the text to provided pygame.display. | win |
hide_toggle() | Shows/hides the text. | None |
get_pos() | If centermode returnes center position of text, if not returnes topleft. | None |
change() | Changes and updates provided variables. | newContent = None, newColor = None, newFontName = None, newFontSize = None |
is_hovered() | Returnes True if the mouse cursor is hovering the text. | None |
move_to() | Moves the text to provided x,y cordinates (instantly, no animation) | x, y |
move() | Moves the text by x, y steps (instantly, no animation) | x, y |
flow() | Moves the text between two points. The more iterations the slower the animation. (Requires update()) | position1(x,y), position2(x,y), iterations |
jump() | Jumpes the text between two points. The more iterations the longer between the jumps. (Requires update()) | position1(x,y), position2(x,y), iterations |
flow_toggle() | Toggles flowing on or off. | None |
jump_toggle() | Toggles jumping on or off. | None |
update() | Every time update is called, 1 iteration for jump() and flow() is done. | None |
Function |
Explanation |
Arguments |
draw() | Draws the element to provided pygame.display. | win |
hide_toggle() | Shows/hides the element. | None |
get_pos() | If centermode returnes center position of element, if not returnes topleft. | None |
change() | Changes and updates provided variables. | newContent = None, newTextColor = None, newFontName = None, newFontSize = None, newRectColor = None, newRectWidth = None, newRectHeight = None, newRectBorderRadius = None |
is_clicked() | Returnes True if element is currently being held down by mouse. | List of clickable elements |
was_clicked() | Returnes True if element was clicked by mouse. | List of clickable elements |
is_hovered() | Returnes True if the mouse cursor is hovering the button. | None |
move_to() | Moves the element to provided x,y cordinates (instantly, no animation) | x, y |
move() | Moves the element by x, y steps (instantly, no animation) | x, y |
flow() | Moves the element between two points. The more iterations the slower the animation. (Requires update()) | position1(x,y), position2(x,y), iterations |
jump() | Jumpes the element between two points. The more iterations the longer between the jumps. (Requires update()) | position1(x,y), position2(x,y), iterations |
flow_toggle() | Toggles flowing on or off. | None |
jump_toggle() | Toggles jumping on or off. | None |
update() | Every time update is called, 1 iteration for jump() and flow() is done. | None |
Function |
Explanation |
Arguments |
draw() | Draws the input element to provided pygame.display. | win |
hide_toggle() | Shows/hides the element. | None |
set_filter() | Filters what can be written into the element, if isAllowed is true only the characters in the filter list will be allowed (f. eks ["1", "2", "a"]), if not the filterList characters will be excluded. | filter: list, isAllowed: bool = True |
work() | Required for the input element to work, the event argument should be pygame.event.get(). | events: list, clickable_elements: list |
get_pos() | If centermode returnes center position of element, if not returnes topleft. | None |
get_value() | Returnes the text written in the input. | None |
change() | Changes and updates provided variables. | newContent = None, newTextColor = None, newFontName = None, newFontSize = None, newRectColor = None, newRectWidth = None, newRectHeight = None, newRectBorderRadius = None |
move_to() | Moves the element to provided x,y cordinates (instantly, no animation) | x, y |
move() | Moves the element by x, y steps (instantly, no animation) | x, y |
flow() | Moves the element between two points. The more iterations the slower the animation. (Requires update()) | position1(x,y), position2(x,y), iterations |
jump() | Jumpes the element between two points. The more iterations the longer between the jumps. (Requires update()) | position1(x,y), position2(x,y), iterations |
flow_toggle() | Toggles flowing on or off. | None |
jump_toggle() | Toggles jumping on or off. | None |
update() | Every time update is called, 1 iteration for jump() and flow() is done. | None |