SplashKit Documentation

website·Indexed 29 days ago

https://sksearchtest.netlify.app/

A comprehensive library for multimedia development, providing APIs for 2D graphics, sprites, animations, audio, networking, JSON manipulation, and user interface design. It includes specialized guides for Raspberry Pi GPIO, camera systems, and cross-platform installation for .NET Core SDK on Windows, macOS, and Linux.

Tokens
43.4K
Snippets
376
Records
433
Agent score
75%

What's inside SplashKit

  1. Overview of SplashKit API Modules

    SplashKit provides a comprehensive set of libraries for game and application development, including:

    • Animations: Manage sequences to move between cells in bitmaps and sprites.
    • Audio: Load and play music and sound effects.
    • Camera: Control a virtual camera to navigate the game world.
    • Color: Simplify color manipulation in graphical apps.
    • Geometry: Perform geometry-related computations.
    • Graphics: Draw bitmaps, sprites, and text to graphic windows.
    • Input: Handle user interactions and keyboard events.
    • Interface: Create UI elements like draggable panels, buttons, and text boxes.
    • Json: Create and read JSON objects.
    • Logging: Streamlined logging with customizable severity levels.
    • Networking: Communicate data across networks.
    • Physics: Perform collision tests between bitmaps, sprites, and shapes; provides matrix and vector functions for 2D coordinates.
    • Raspberry Pi: Read and write to GPIO pins on Raspberry Pi hardware.
    • Resource Bundles & Resources: Locate and load assets from the project's Resources folder.
    • Sprites: Create, move, and animate images.
    • Terminal: Consistent reading and writing to the terminal.
    • Timers: Track the passage of time.
    • Types: Simplify data type creation and management.
    • Utilities: Basic data manipulation, random number generation, and miscellaneous helper functions.
    • Windows: Create and manipulate graphics windows via the Window Manager.
  2. Install .NET SDK on macOS using Homebrew

    If the command brew cask install dotnet-sdk fails, use the updated syntax for Homebrew casks. Ensure you select the correct architecture: Arm64 for Apple Silicon (M1, M2, etc.) and x64 for Intel-based Macs.
    brew install dotnet-sdk --cask
  3. Use Bitmaps for image resources

    Bitmaps represent image resources. They can be created by loading from a file, downloading from the internet, or by drawing directly onto them. Bitmaps can be drawn to the screen or used as a destination for other drawing operations.
  4. Understand SplashKit Animation concepts

    Animations in SplashKit function like a flip book, cycling through images (cells) from a sprite sheet based on an animation script.

    • Sprite Sheet: A single bitmap image divided into equal-sized cells. Cells are indexed from 0 (top-left) to the total count (bottom-right).
    • Animation Script: A text file that defines how cells are sequenced. Scripts are decoupled from specific images, meaning one script can be applied to multiple bitmaps if they share the same cell layout.
    • Frames: The building blocks of a script. Each frame defines:
      • An identifier (index).
      • The cell index to draw.
      • Duration (how many updates the frame stays on screen).
      • The next frame index (creating a sequence or loop).
  5. Understand PWM concepts for LED control

    Pulse Width Modulation (PWM) emulates analog signals using digital pins by rapidly switching the pin on and off. Three primary parameters control the output:

    • PWM Frequency: The number of on-off cycles per second (measured in Hertz). Higher frequencies result in smoother output and less perceptible flickering.
    • PWM Duty Cycle: The percentage of time the pin is 'high' (on) versus 'low' (off) within a single cycle. Increasing the duty cycle increases the average power delivered, making an LED appear brighter.
    • PWM Range: The resolution of the duty cycle. A range of 255 allows for 256 discrete increments (0% to 100%).
  6. Use Fonts for text rendering

    Fonts are used to draw text in SplashKit. They can be loaded from a local file or downloaded from the internet and are then passed to text drawing procedures.
  7. Manage game world views using the SplashKit Camera

    The SplashKit Camera allows you to create a game world larger than the window size. By default, the camera is at (0,0). When you change the camera position, SplashKit translates 'game coordinates' (the entity's position relative to the world) into 'screen coordinates' (the actual pixel position on the window) based on the camera offset. The camera position defines the coordinate of the top-left corner of the window.