diff --git a/public/usage-examples/animations/sprite-animation/sprite-animation.py b/public/usage-examples/animations/sprite-animation/sprite-animation.py new file mode 100644 index 000000000..bd8f3ae00 --- /dev/null +++ b/public/usage-examples/animations/sprite-animation/sprite-animation.py @@ -0,0 +1,21 @@ +from splashkit import * + +open_window("Sprite Animation Example", 800, 600) + +player_bitmap = load_bitmap("player", "player.png") +player = create_sprite(player_bitmap) + +sprite_set_x(player, 0) +sprite_set_y(player, 300) + +while not quit_requested(): + process_events() + + # Move sprite across screen + sprite_set_x(player, sprite_x(player) + 2) + + clear_screen(ColorWhite) + + draw_sprite(player) + + refresh_screen(60) \ No newline at end of file diff --git a/public/usage-examples/animations/sprite-animation/sprite-animation.txt b/public/usage-examples/animations/sprite-animation/sprite-animation.txt new file mode 100644 index 000000000..e69de29bb diff --git a/scripts/json-files/guides-groups.json b/scripts/json-files/guides-groups.json index 7fe7bccde..3f1385eaa 100644 --- a/scripts/json-files/guides-groups.json +++ b/scripts/json-files/guides-groups.json @@ -1,10 +1,10 @@ [ + "Camera", + "Graphics", "animations", "audio", "beyond-splashkit", - "camera", "color", - "graphics", "input", "interface", "json", diff --git a/scripts/json-files/usage-example-references.json b/scripts/json-files/usage-example-references.json index c41688ec6..8dc2b221e 100644 --- a/scripts/json-files/usage-example-references.json +++ b/scripts/json-files/usage-example-references.json @@ -38,6 +38,31 @@ ] } ], + "color": [ + { + "funcKey": "saturation_of", + "title": "Draws a rectangle in a random colour. The colour's saturation value is displayed on screen", + "url": "/api/color/#saturation-of", + "functions": [ + "open_window", + "random_rgb_color", + "round", + "rectangle_from", + "clear_screen", + "color_white", + "fill_rectangle_record", + "draw_text_no_font_no_size", + "color_black", + "red_of", + "green_of", + "blue_of", + "alpha_of", + "refresh_screen", + "delay", + "close_all_windows" + ] + } + ], "geometry": [ { "funcKey": "center_point", @@ -524,6 +549,32 @@ "close_window" ] }, + { + "funcKey": "rectangle_around", + "title": "A perpetually moving circle which increases and decreases in size, surrounded by a rectangle shape", + "url": "/api/geometry/#rectangle-around", + "functions": [ + "open_window", + "create_timer", + "start_timer", + "quit_requested", + "point_at", + "cosine", + "sine", + "circle_at", + "timer_ticks", + "reset_timer", + "process_events", + "clear_screen_to_white", + "draw_rectangle_record", + "color_black", + "rectangle_around_circle", + "fill_circle_record", + "color_red", + "refresh_screen", + "close_all_windows" + ] + }, { "funcKey": "same_point", "title": "Point 2D Guessing Game", @@ -561,6 +612,24 @@ "close_all_windows" ] }, + { + "funcKey": "bitmap_center", + "title": "Draw a bitmap with a red dot at its center\r", + "url": "/api/graphics/#bitmap-center", + "functions": [ + "open_window", + "load_bitmap", + "clear_screen", + "color_white", + "draw_bitmap", + "fill_circle_record", + "color_red", + "circle_at", + "refresh_screen", + "delay", + "close_all_windows" + ] + }, { "funcKey": "clear_screen", "title": "Background Color", @@ -597,6 +666,26 @@ "SplashKit" ] }, + { + "funcKey": "draw_circle", + "title": "Circle Showcase", + "url": "/api/graphics/#draw-circle", + "functions": [ + "open_window", + "clear_screen", + "color_white", + "fill_circle", + "color_red", + "color_blue", + "color_green", + "color_orange", + "color_purple", + "random_rgb_color", + "refresh_screen", + "delay", + "close_all_windows" + ] + }, { "funcKey": "draw_circle_on_bitmap", "title": "Creating a Red Planet", @@ -1189,6 +1278,25 @@ "close_all_windows" ] }, + { + "funcKey": "get_font_style", + "title": "The program automatically cycles through font styles for a given font (also displaying example text), with the numerical value of each style being shown on screen\r", + "url": "/api/graphics/#get-font-style", + "functions": [ + "open_window", + "font_named", + "quit_requested", + "process_events", + "set_font_style", + "clear_screen_to_white", + "draw_text_no_font_no_size", + "color_black", + "draw_text", + "refresh_screen", + "delay", + "close_all_windows" + ] + }, { "funcKey": "has_font", "title": "Checking for Font using Variable", @@ -1790,5 +1898,30 @@ "write_line" ] } + ], + "windows": [ + { + "funcKey": "close_window", + "title": "Starts a countdown to close the window at the push of a button.", + "url": "/api/windows/#close-window", + "functions": [ + "open_window", + "create_timer", + "quit_requested", + "process_events", + "clear_window", + "color_white", + "button_at_position", + "rectangle_from", + "start_timer", + "draw_text_font_as_string", + "color_black", + "timer_ticks", + "reset_timer", + "draw_interface", + "refresh_window", + "close_all_windows" + ] + } ] } \ No newline at end of file