Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
ac4bbb9
Dynamic Camera Control Tutorial (#177)
sharvani28 Feb 10, 2025
5886862
Shape Modelling Tutorial (#180)
Srainyyyy Feb 10, 2025
a4d508f
Merge branch 'splashkit:master' into new/tutorial/camera-movement
omckeon Feb 10, 2025
94e8c30
Merge branch 'splashkit:master' into new/tutorial/graphics-shape-mode…
omckeon Feb 10, 2025
d6ca5a1
Merge branch 'splashkit:master' into new/tutorial/camera-movement
omckeon Feb 17, 2025
b081e35
Merge branch 'splashkit:master' into new/tutorial/graphics-shape-mode…
omckeon Feb 17, 2025
d669fdd
Merge branch 'splashkit:master' into new/tutorial/graphics-shape-mode…
omckeon Mar 13, 2025
258ffa4
Merge branch 'splashkit:master' into new/tutorial/camera-movement
omckeon Mar 13, 2025
f77c917
Merge branch 'splashkit:master' into new/tutorial/camera-movement
omckeon Apr 9, 2025
acc1360
Merge branch 'splashkit:master' into new/tutorial/graphics-shape-mode…
omckeon Apr 9, 2025
7f5172f
Merge branch 'master' of https://github.com/splashkit/splashkit.io-st…
omckeon May 5, 2025
21bb572
Merge branch 'master' of https://github.com/splashkit/splashkit.io-st…
omckeon May 5, 2025
3609d43
Merge branch 'master' of https://github.com/splashkit/splashkit.io-st…
omckeon May 5, 2025
c72dee1
Merge branch 'splashkit:master' into new/tutorial/graphics-shape-mode…
omckeon May 5, 2025
34ba8a2
reviewed all code and text, only added a missing space
ctrlvish Aug 1, 2025
c9bae5d
wrote code for object oriented c# and python
ctrlvish Aug 2, 2025
c382868
updated author and last updated
ctrlvish Aug 2, 2025
00a5cc3
Added usage example for Close Window Function
JulianBurton Aug 10, 2025
8a163b5
updated python function for consistency
ctrlvish Aug 19, 2025
42cf2da
1. updated wording and fix grammer mistakes
ctrlvish Aug 20, 2025
ac814f6
translated remaining code in the tutorial.
ctrlvish Aug 21, 2025
db40835
Add files via upload
CATHoDE33 Aug 23, 2025
1670484
Add files via upload
CATHoDE33 Aug 26, 2025
7095da3
changes to cpp and cs styling
ctrlvish Aug 27, 2025
b112014
updated function for consistency
ctrlvish Aug 27, 2025
0a11e84
Add files via upload
CATHoDE33 Aug 28, 2025
54abe4d
changes to code styling
ctrlvish Aug 29, 2025
7870dc1
Add files via upload
CATHoDE33 Sep 1, 2025
28696e0
changed files to match feedback given
JulianBurton Sep 1, 2025
ac80332
fixed formatting
ctrlvish Sep 3, 2025
470816e
Safe local fallback for Algolia env vars
ctrlvish Jul 26, 2025
65c0d36
Fix typo in script
ctrlvish Sep 10, 2025
5bad740
Revert "Safe local fallback for Algolia env vars"
ctrlvish Sep 10, 2025
56e0770
Add files via upload
CATHoDE33 Sep 10, 2025
36ad639
changes made
JulianBurton Sep 11, 2025
55fb8fd
Add files via upload
CATHoDE33 Sep 16, 2025
20077c9
adding game tutorial
ctrlvish Sep 19, 2025
1479153
Add files via upload
CATHoDE33 Sep 19, 2025
31a3a4d
updated tutorial to use imported and bigger font
ctrlvish Sep 21, 2025
2b1e417
Add files via upload
CATHoDE33 Sep 25, 2025
e42da62
Add draw circle graphics usage examples
222448082Ashen Dec 5, 2025
5c26eba
Merge pull request #640 from CATHoDE33/rectangle_around
monicavtasmin Dec 6, 2025
aac8a7f
Merge pull request #573 from JulianBurton/CloseWindow
monicavtasmin Dec 6, 2025
df41a11
Merge pull request #585 from CATHoDE33/bitmap_center
monicavtasmin Dec 6, 2025
ec006f1
Merge pull request #631 from ctrlvish/apipagesbug
monicavtasmin Dec 6, 2025
038e3cd
Merge pull request #642 from ctrlvish/new-game-tutorial
monicavtasmin Dec 6, 2025
e844751
Merge pull request #677 from 222448082Ashen/usageExamples/graphics
monicavtasmin Jan 18, 2026
fa008e5
Merge pull request #580 from ctrlvish/shape-tutorial
monicavtasmin Jan 18, 2026
e067e4a
Merge pull request #596 from CATHoDE33/get_font_style
monicavtasmin Jan 25, 2026
6eee48c
Merge pull request #567 from ctrlvish/camera-tutorial
monicavtasmin Feb 1, 2026
304447e
Merge pull request #607 from CATHoDE33/saturation_of
monicavtasmin Feb 2, 2026
9996475
Merge branch 'splashkit:master' into main
omckeon Mar 10, 2026
e98e127
Merge branch 'master' of https://github.com/splashkit/splashkit.io-st…
omckeon Apr 15, 2026
6109ffd
Merge branch 'master' of https://github.com/splashkit/splashkit.io-st…
omckeon Apr 15, 2026
29487ec
Merge branch 'master' of https://github.com/splashkit/splashkit.io-st…
omckeon Apr 15, 2026
739abeb
feat: Add terminal-based AI conversation examples
Issacmadassery1 May 17, 2026
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
Binary file not shown.
Binary file not shown.
27 changes: 27 additions & 0 deletions public/usage-examples/color/saturation_of-1-example-oop.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
using SplashKitSDK;

namespace SaturationOfExample
{
public class Program
{
public static void Main()
{
SplashKit.OpenWindow("Saturation Of", 800, 600);

Color color = SplashKit.RandomRGBColor(255);
// Function used here ↓
double colorSaturation = Math.Round(SplashKit.SaturationOf(color), 6);
Rectangle rectangle = SplashKit.RectangleFrom(200, 100, 400, 300);

SplashKit.ClearScreen(Color.White);
SplashKit.FillRectangle(color, rectangle);
SplashKit.DrawText("This color's saturation is " + colorSaturation.ToString(), Color.Black, 235, 450);
SplashKit.DrawText("It's RGBA values are: R-" + SplashKit.RedOf(color) + ", G-" + SplashKit.GreenOf(color) + ", B-" + SplashKit.BlueOf(color) + ", A-" + SplashKit.AlphaOf(color), Color.Black, 235, 470);
SplashKit.RefreshScreen();

SplashKit.Delay(5000);

SplashKit.CloseAllWindows();
}
}
}
19 changes: 19 additions & 0 deletions public/usage-examples/color/saturation_of-1-example-top-level.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using SplashKitSDK;
using static SplashKitSDK.SplashKit;

OpenWindow("Saturation Of", 800, 600);

Color color = RandomRGBColor(255);
// Function used here ↓
double colorSaturation = Math.Round(SaturationOf(color), 6);
Rectangle rectangle = RectangleFrom(200, 100, 400, 300);

ClearScreen(ColorWhite());
FillRectangle(color, rectangle);
DrawText("This color's saturation is " + colorSaturation.ToString(), ColorBlack(), 235, 450);
DrawText("It's RGBA values are: R-" + RedOf(color) + ", G-" + GreenOf(color) + ", B-" + BlueOf(color) + ", A-" + AlphaOf(color), ColorBlack(), 235, 470);
RefreshScreen();

Delay(5000);

CloseAllWindows();
22 changes: 22 additions & 0 deletions public/usage-examples/color/saturation_of-1-example.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#include "splashkit.h"

int main()
{
open_window("Saturation Of", 800, 600);

color color = random_rgb_color(255);
// Function used here ↓
double color_saturation = saturation_of(color);
rectangle rectangle = rectangle_from(200, 100, 400, 300);

clear_screen(color_white());
fill_rectangle(color, rectangle);
draw_text("This color's saturation is " + std::to_string(color_saturation), color_black(), 235, 450);
draw_text("It's RGBA values are: R-" + std::to_string(red_of(color)) + ", G-" + std::to_string(green_of(color)) + ", B-" + std::to_string(blue_of(color))+ ", A-" + std::to_string(alpha_of(color)), color_black(), 235, 470);
refresh_screen();

delay(5000);

close_all_windows();
return 0;
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions public/usage-examples/color/saturation_of-1-example.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from splashkit import *

open_window("Saturation Of", 800, 600)

color = random_rgb_color(255)
# Function used here ↓
color_saturation = round(saturation_of(color), 6)
rectangle = rectangle_from(200, 100, 400, 300)

clear_screen(color_white())
fill_rectangle_record(color, rectangle)
draw_text_no_font_no_size("This color's saturation is " + str(color_saturation), color_black(), 235, 450)
draw_text_no_font_no_size("It's RGBA values are: R-" + str(red_of(color)) + ", G-" + str(green_of(color)) + ", B-" + str(blue_of(color)) + ", A-" + str(alpha_of(color)), color_black(), 235, 470)
refresh_screen()

delay(5000)

close_all_windows()
1 change: 1 addition & 0 deletions public/usage-examples/color/saturation_of-1-example.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Draws a rectangle in a random colour. The colour's saturation value is displayed on screen
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
// Simple Terminal AI Conversation - OOP C# Example
// This example uses a class structure

using SplashKitSDK;

class AIConversation
{
// Main entry point
static void Main()
{
// Create an instance of the conversation class
AIConversation conversation = new AIConversation();

// Run the conversation
conversation.Start();
}

// Method to start the conversation loop
public void Start()
{
// Display welcome message
SplashKit.ClearScreen();
SplashKit.WriteLine("=== Terminal AI Conversation ===");
SplashKit.WriteLine("Type your message and press Enter to chat with AI");
SplashKit.WriteLine("Type 'quit' to exit");
SplashKit.WriteLine("");

// Continue conversation until user quits
while (true)
{
string userMessage = GetUserInput();

// Check if user wants to quit
if (userMessage == "quit")
{
SplashKit.WriteLine("Goodbye!");
break;
}

// Skip empty messages
if (string.IsNullOrWhiteSpace(userMessage))
{
continue;
}

// Get and display AI response
DisplayAIResponse(userMessage);
}
}

// Method to get user input
private string GetUserInput()
{
SplashKit.Write("You: ");
return SplashKit.ReadLine();
}

// Method to generate and display AI response
private void DisplayAIResponse(string userMessage)
{
// Generate AI response using generate_text()
string aiResponse = SplashKit.GenerateText(userMessage);

// Display the response
SplashKit.WriteLine("AI: " + aiResponse);
SplashKit.WriteLine("");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// Simple Terminal AI Conversation - Top-Level C# Example
// This example uses top-level statements (C# 9+)

using SplashKitSDK;

// Display welcome message
SplashKit.ClearScreen();
SplashKit.WriteLine("=== Terminal AI Conversation ===");
SplashKit.WriteLine("Type your message and press Enter to chat with AI");
SplashKit.WriteLine("Type 'quit' to exit");
SplashKit.WriteLine("");

string userMessage;

// Simple conversation loop
while (true)
{
// Get user input
SplashKit.Write("You: ");
userMessage = SplashKit.ReadLine();

// Check if user wants to quit
if (userMessage == "quit")
{
SplashKit.WriteLine("Goodbye!");
break;
}

// Skip empty messages
if (string.IsNullOrWhiteSpace(userMessage))
{
continue;
}

// Generate AI response using generate_text()
string aiResponse = SplashKit.GenerateText(userMessage);

// Display AI response
SplashKit.WriteLine("AI: " + aiResponse);
SplashKit.WriteLine("");
}
48 changes: 48 additions & 0 deletions public/usage-examples/generative_ai/generate-convo-1-example.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#include "splashkit.h"
#include <string>
#include <iostream>

int main()
{
// Initialize SplashKit
open_window("AI Conversation Example", 800, 600);

// Display welcome message
write_line("=== Terminal AI Conversation ===");
write_line("Type your message and press Enter to chat with AI");
write_line("Type 'quit' to exit");
write_line("");

std::string user_message;

// Simple conversation loop
while (true)
{
// Get user input
write("You: ");
user_message = read_line();

// Check if user wants to quit
if (user_message == "quit")
{
write_line("Goodbye!");
break;
}

// Skip empty messages
if (user_message.empty())
{
continue;
}

// Generate AI response using generate_text()
std::string ai_response = generate_text(user_message);

// Display AI response
write_line("AI: " + ai_response);
write_line("");
}

close_window("AI Conversation Example");
return 0;
}
38 changes: 38 additions & 0 deletions public/usage-examples/generative_ai/generate-convo-1-example.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Simple Terminal AI Conversation - Python Example

from splashkit import *

def main():
"""Main function to run the AI conversation"""

# Display welcome message
clear_screen()
print("=== Terminal AI Conversation ===")
print("Type your message and press Enter to chat with AI")
print("Type 'quit' to exit")
print("")

# Simple conversation loop
while True:
# Get user input
user_message = input("You: ")

# Check if user wants to quit
if user_message.lower() == "quit":
print("Goodbye!")
break

# Skip empty messages
if not user_message.strip():
continue

# Generate AI response using generate_text()
ai_response = generate_text(user_message)

# Display AI response
print(f"AI: {ai_response}")
print("")

# Run the program
if __name__ == "__main__":
main()
72 changes: 72 additions & 0 deletions public/usage-examples/generative_ai/generate-convo-1-example.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
Simple Terminal AI Conversation Example
========================================

Overview
--------
This example demonstrates how to create a simple terminal-based AI conversation
using the generate_text() function from SplashKit.

How It Works
-----------
1. The program displays a welcome message
2. User types a message and presses Enter
3. The message is sent to generate_text()
4. The AI response is printed in the terminal
5. The user can continue the conversation or type 'quit' to exit

Key Concepts
-----------
- Input/Output: Reading user input and displaying responses
- generate_text(): The SplashKit function that generates AI responses
- Loops: Using a while loop to maintain the conversation
- String Handling: Working with text input and output

Code Flow
---------
Welcome Message
Loop Start
Get User Input
Check for 'quit'
Generate AI Response
Display Response
Loop Back (until user types 'quit')

Example Usage
-----------
=== Terminal AI Conversation ===
Type your message and press Enter to chat with AI
Type 'quit' to exit

You: Hello, how are you?
AI: I'm doing well, thank you for asking! How can I assist you today?

You: What is SplashKit?
AI: SplashKit is a cross-platform C++ library that makes it easy to learn
and teach programming through games and multimedia applications.

You: quit
Goodbye!

Files Included
--------------
1. generate-convo-1-example.cpp - C++ version
2. generate-convo-1-example-top-level.cs - C# top-level statements version
3. generate-convo-1-example-oop.cs - C# object-oriented version
4. generate-convo-1-example.py - Python version
5. generate-convo-1-example.txt - This documentation file

Learning Tips
-------------
- Start with the Python version if you're new to programming
- The top-level C# version is good for understanding basic structure
- The OOP versions show how to organize code into reusable methods
- Try modifying the program to add new features like:
* Saving conversation history
* Adding more elaborate welcome messages
* Creating a conversation history log
Loading