Skip to content

Usage Example Overview

What are Usage Examples?

Usage examples demonstrate a specific Splashkit function within a simple, small program. The goal is to keep the program minimal while clearly showing how the function works.

For instance, the write_line example on the Splashkit site found here, clicking on the See Code Example shows how the write_line function works, with a brief title of the program, program code, and a screenshot of the output.

The following pages cover all the steps to create, submit, and review usage examples for the Splashkit website.

Steps to Completing a Usage Example

  1. Choose a Planner Card or Idea

    Pick an existing planner card that matches a SplashKit function, or create a unique example.

    Make sure the idea clearly demonstrates the function in a practical or visually interesting way.

  2. Develop a Demonstrative Program

    Write a simple program to illustrate the function’s use. Focus on clarity and simplicity, ensuring that the code is easy to follow and that it showcases the function effectively.

  3. Write the Program in Multiple Languages

    • C++: Implement the example with standard C++ practices.
    • C#: Provide both a version using top-level statements and an Object-Oriented (OOP) version.
    • Python: Write a Python version that is straightforward and reflects the same functionality.
  4. Create a Title for the example

    • Think of a title that describes the overall functionality of the program.
    • Be creative with this title. It should not be the name of the function, or use the word “Example”.
  5. Capture Output of Program

    Run the program in any of the languages to capture the details of the program running.

    You might do this with a screenshot, screen recording converted to a GIF, or an audio recording.

    Output FormatAccepted File TypeExample of when to use
    Screenshots.png fileSimple program without any user inputs or animations.
    Screen Recording.gif fileThe program has user inputs or animations to demonstrate.
    Audio Recording.webm fileThe program include audio sounds.
  6. Add Files to the Correct Folder in the SplashKit Repository

    • Copy your files into the appropriate folder within the splashkit.io-starlight repository.
    • Ensure file names and directory paths are consistent with SplashKit’s structure.
  7. Submit a Pull Request for Usage Examples

    Follow the steps in the Pull Requests for Usage Examples guide.

    Use the provided PR template, describe your example clearly, and attach explanations and screenshots to the pull request.