Skip to content

Add animation usage examples in multiple languages#683

Open
222448082Ashen wants to merge 1 commit intothoth-tech:usage-examplesfrom
222448082Ashen:usage-examples
Open

Add animation usage examples in multiple languages#683
222448082Ashen wants to merge 1 commit intothoth-tech:usage-examplesfrom
222448082Ashen:usage-examples

Conversation

@222448082Ashen
Copy link

Description

Category: animations

What this PR adds: Updated existing Animations usage examples with real resources and screenshots, plus added missing example sets required by the generated API documentation. All examples now reference actual animation scripts from BasicAnimationResources.zip in the repo.

Type of change

  • Bug fix (non-breaking change which fixes incorrect/missing resources)
  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

  • Updated 6 existing examples to use real animation resources (kermit.txt, explosion.txt) from public/resources/guides/animation/basics/BasicAnimationResources.zip
  • Generated real output screenshots (PNG files) for all 9 animation examples
  • Successfully ran npm run build with all examples integrated
  • Verified Animations API page generation includes all examples with screenshots

Testing Checklist

  • npm run build (completes successfully, regenerates API MDX pages)
  • npm run dev (local preview confirms Animations page renders with screenshots)
  • All example files follow repo conventions (C++, C# top-level, C# OOP, Python, .txt, output image)

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • Examples reference valid resources and produce accurate output
  • My changes generate no new warnings

Files Modified/Added

Updated Examples (under public/usage-examples/animations/):

  • load_animation_script-1-example.* - Now loads kermit.txt with proper resource notes
  • create_animation-1-example.* - Uses kermit.txt and WalkFront animation
  • update_animation-1-example.* - Updated with real resource and formatted output
  • animation_entered_frame-1-example.* - Uses kermit.txt, formatted bool output
  • animation_frame_time-1-example.* - Updated resource reference and output format
  • animation_ended-1-example.* - Uses explosion.txt (non-looping animation scenario)

New Examples Added (under public/usage-examples/animations/):

  • free_animation-1-example.* (6 files: C++, C# top-level, C# OOP, Python, .txt, .png)
  • free_animation_script-1-example.* (6 files)
  • restart_animation-1-example.* (6 files)

Generated Output Images (PNG screenshots for all 9 examples):

  • Real screenshots generated from animation resources (frog sprite cells, explosion sprite)
  • File sizes ~29KB–66KB (non-placeholder images)

Additional Notes

  • All examples now reference existing bundled resources: public/resources/guides/animation/basics/BasicAnimationResources.zip
  • Examples use script names WalkingScript with animation WalkFront (from kermit.txt) and ExplosionScript with explosion (from explosion.txt)
  • Each example .txt file includes download instructions pointing to /resources/guides/animation/basics/BasicAnimationResources.zip
  • The API page generation script successfully imports and renders all examples with screenshots

Added example code and documentation for various animation operations (such as creating, updating, freeing, and restarting animations) in C#, C++, and Python. Each example demonstrates a specific animation API usage with corresponding resource notes and images for reference.
@netlify
Copy link

netlify bot commented Dec 21, 2025

Deploy Preview for splashkit ready!

Name Link
🔨 Latest commit 70f597d
🔍 Latest deploy log https://app.netlify.com/projects/splashkit/deploys/6947a1b1328f7b00085398c0
😎 Deploy Preview https://deploy-preview-683--splashkit.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@stantheman96
Copy link

✅ Peer Review – AnimationEndedExample.cs

Type of Change:
New Feature / Demo Example

Readability:

Code is clean and well-structured

Good use of comments via SplashKit.WriteLine for debugging

Variable names are clear and self-explanatory

Follows standard SplashKit conventions

Functionality:

Demonstrates AnimationEnded() usage clearly

Includes update loop with delay and conditional check

Proper resource management with FreeAnimation() and FreeAnimationScript() at the end

Console output helps visualize animation progress and ending

Suggestions (Minor):

Could optionally add a SplashKit.OpenWindow(...) call to display visuals, even if not needed for logic

Adding a comment at the top describing the purpose (e.g. “Demonstrates detecting when an animation ends using SplashKit”) would help future readers

Verdict:
Great example — clear, functional, and does exactly what it’s meant to. Well done! 👏

Copy link

@stantheman96 stantheman96 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved see earlier comment for detailed feedback

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants