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
-
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.
-
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.
-
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.
-
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”.
-
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 Format Accepted File Type Example of when to use Screenshots .pngfileSimple program without any user inputs or animations. Screen Recording .giffileThe program has user inputs or animations to demonstrate. Audio Recording .webmfileThe program include audio sounds. -
Add Files to the Correct Folder in the SplashKit Repository
- Copy your files into the appropriate folder within the
splashkit.io-starlightrepository. - Ensure file names and directory paths are consistent with SplashKit’s structure.
- Copy your files into the appropriate folder within the
-
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.