Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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)
Empty file.
4 changes: 2 additions & 2 deletions scripts/json-files/guides-groups.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[
"Camera",
"Graphics",
"animations",
"audio",
"beyond-splashkit",
"camera",
"color",
"graphics",
"input",
"interface",
"json",
Expand Down
133 changes: 133 additions & 0 deletions scripts/json-files/usage-example-references.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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"
]
}
]
}