Skip to content

GraphicsObject: The Mother of All

Bhavye Mathur edited this page Jul 27, 2020 · 9 revisions

All GraphicsObject functions:

draw(graphwin=None, _internal_call=False)
undraw(set_blinking=False)
redraw()
destroy()

Layering Functions

move_up_layer(layers=1)
move_down_layer(layers=1)
set_layer(layer=0)
set_clickable(clickable=True)
set_draggable(draggable_x=True, draggable=None, callback_x=None, callback_y=None)
set_draggable_x(draggable=True, callback=None)
set_draggable_y(draggable=True, callback=None)
set_selected(selected=True)
set_fill(colour)
set_outline(colour)
set_outline_width(width)
set_cursor(cursor="arrow")

Obstacle Functions

add_obstacle(obj)
add_obstacle(obstacles, destroy_previous=True)
remove_obstacle(obj)
clear_obstacles()
copy_obstacles_from(other, create_copy=True)
draw_obstacles()
undraw_obstacles()
enable_obstacles()
disable_obstacles()
set_enabled_obstacles(enabled=True)
toggle_obstacles_enabled()

Movement Bounds Functions

set_movement_bounds(obj, allow_looping_x=False, allow_looping_y=False)
set_allow_movement_looping(allow_looping_x=False, allow_looping_y=False)
add_movement_line(obj)

Movement Line Functions

set_movement_lines(lines, destroy_previous=True)
remove_movement_line(obj)
clear_movement_lines()
copy_movement_lines_from(other, create_copy=True)
draw_movement_lines()
undraw_movement_lines()
enable_movement_lines()
disable_movement_lines()
set_enabled_movement_lines()
toggle_movement_lines_enabled()

Movement Functions

move(dx, dy, align="center")
move_y(dy, align="center")
move_x(dx, align="center")
move_to(x, y, align="center")
move_to_y(y, align="center")
move_to_x(x, align="center")
move_to_point(p, align="center")
move_forward(d, collision_callback=None)
move_backward(d, collision_callback=None)
move_left(d, collision_callback=None)
move_right(d, collision_callback=None)
rotate(dr, sampling="bicubic", center=None)
set_rotation(r, sampling="bicubic", center=None)
skew_x(scale, sampling="bicubic", align="center")
skew_y(scale, sampling="bicubic", align="center")
skew_xy(x_scale, y_scale=None, sampling="bicubic", x_align="center", y_align="center")
skew(scale, sampling="bicubic", align="center", skew_x=True, skew_y=True)

Animation Functions

animate_blinking(interval, animate=True, blink_graphic=None, number_of_blinks=None)

All Animation easing arguments default to ease_linear() unless otherwise mentioned
All Animation duplicates_metric arguments default to ("Time", "Initial", "Change")
All Animation allow_duplicate arguments default to True

Gliding Animations

glide(dx, dy, time, easing_x, easing_y=None, allow_duplicate, duplicates_metric)
glide_x(dx, time, easing, allow_duplicate, duplicates_metric)
glide_y(dy, time, easing, allow_duplicate, duplicates_metric)
glide_to(x, y, time, easing_x, easing_y=None, allow_duplicate, duplicates_metric)
glide_to_x(x, time, easing, allow_duplicate, duplicates_metric)
glide_to_y(y, time, easing, allow_duplicate, duplicates_metric)
glide_to_point(p, time, easing_x, easing_y, allow_duplicate, duplicates_metric)

Rotating Animations

animate_rotate(dr, time, easing, allow_duplicate, duplicates_metric)
animate_set_rotation(r, time, easing, allow_duplicate, duplicates_metric)

Colour Animations

animate_change_fill(colour_change, time, easing, allow_duplicate, duplicates_metric)
animate_set_fill(end_colour, time, easing, allow_duplicate, duplicates_metric)
animate_change_outline(colour_outline, time, easing, allow_duplicate, duplicates_metric)
animate_set_outline(end_colour, time, easing, allow_duplicate, duplicates_metric)
animate_change_outline_width(width_change, time, easing, allow_duplicate, duplicates_metric)
animate_set_outline_width(width_change, time, easing, allow_duplicate, duplicates_metric)

Skewing Animations

animate_skew_x(skew_change, time, easing, allow_duplicate, duplicates_metric)
animate_skew_y(skew_change, time, easing, allow_duplicate, duplicates_metric)
animate_skew(skew_change_x, skew_change_y, time, easing_x, easing_y=None, allow_duplicate, duplicates_metric)

Image Specific Animations

animate_change_contrast(contrast_change, time, easing, allow_duplicate, duplicates_metric)
animate_set_contrast(contrast, time, easing, allow_duplicate, duplicates_metric)
animate_change_blur(blur_change, time, easing, allow_duplicate, duplicates_metric)
animate_set_blur(blur, time, easing, allow_duplicate, duplicates_metric)

Getter Functions

get_width()
get_height()
get_size()
get_anchor()
get_x_pos()
get_y_pos()
get_cursor()
get_config_options()
get_fill()
get_outline()
get_outline_width()
get_x_skew()
get_y_skew()
get_skew()
get_rotation()
get_layer()
get_obstacles()
get_movement_looping()
get_movement_bounds()
get_tag()
is_x_looping_allowed(
is_y_looping_allowed()
check_is_gliding()
check_is_rotating()
check_is_animating_fill()
check_is_animating_outline()
check_is_animating_outline_width()
check_is_skewing()
check_is_animating_contrast()
check_is_animating_blur()
check_is_blinking()
check_is_animating()
gliding_time_left()
rotating_time_left()
animating_fill_time_left()
animating_outline_time_left()
animating_outline_width_time_left()
skewing_time_left()
animating_contrast_time_left()
animating_blur_time_left()

Static Functions

get_layer_objects(layer=0)
get_tagged_object(tag)
check_animation_exists(animations, check_animation, duplicates_metric=("Time", "Initial", "Change"))
Clone this wiki locally