Repository navigation
docs: add getting started with sprites guide - #42
Open
thelocalfrogman wants to merge 1 commit into
Open
thelocalfrogman wants to merge 1 commit into
thelocalfrogman wants to merge 1 commit into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds a getting started guide for SplashKit Sprites to the Tutorials and Guides section.
The documentation has extensive Sprites API coverage and usage examples but no Sprites guide in the Getting Started path, and the Animations guide explicitly scopes itself to animations without sprites. This guide covers creating a sprite from a bitmap, positioning and drawing, velocity and why
Update Spriteis what actually moves the sprite, keyboard control, keeping a sprite inside the window, using more than one sprite from a single bitmap, and freeing sprites, then closes with a complete Example Code program matching the Audio and Camera guides.Examples are in C++, C# top-level statements, C# object-oriented and Python. The runnable examples reuse the existing
sprite_set_velocityresource bundle rather than adding duplicate game assets. The guide also includes one GIF and seven annotated stills, five of them captured from real SplashKit output and two of them diagrams.Type of change
How Has This Been Tested?
Every code block in the guide was compiled and run against the SplashKit SDK on Linux, using the
player-run.pngresource the guide links to. The C++ examples compile withg++and the complete programs run with arrow-key movement and edge clamping behaving as described, both C# variants build with 0 warnings and 0 errors, and the Python programs run.The C#
Spriteclass has noFree()method, so the object-oriented example usesSplashKit.FreeSprite(playerSprite)rather than instance syntax, and the guide calls that difference out so readers don't have trouble with it.npm run buildcompletes with 119 pages built, no errors, and Astro's link validation reporting all internal links valid.Testing Checklist
Both browsers were checked against the
npm run previewbuild. The page renders correctly in each, the images load, and both tab groups switch and stay in sync across the page.Checklist
If involving code
If modified config files
Folders and Files Added/Modified
src/content/docs/guides/sprites/getting-started-with-sprites.mdxpublic/gifs/guides/sprites/sprite-keyboard-movement.gifsrc/content/docs/guides/sprites/images/(7 PNGs)src/content/docs/guides/index.mdxastro.config.mjsscripts/json-files/guides-groups.jsonAdditional Notes
Related material also exists in Thoth Tech's
SplashKit-Tutorialrepository, including Ashley T's Getting Started With Sprites tutorial. This guide was written separately for the current Starlight documentation and expands the topic into the site's multi-language guide format.The stills are co-located at
guides/sprites/images/rather thanpublic/imagesasCONTRIBUTE.mddescribes. Current practice in the repository is split, and the neighbouring Audio, Animations and Camera guides all carry their ownimages/folder, so this follows the sibling Getting Started guides. Happy to move them if you would rather.This PR is limited to the guide, its images and its navigation entries. It does not change the Sprites API pages, usage-example generation, the build system, or existing examples.