From e1b900a30b65f14e241e8ced0137046006972c8a Mon Sep 17 00:00:00 2001 From: "dev-docs-github-app-dev[bot]" <178211755+dev-docs-github-app-dev[bot]@users.noreply.github.com> Date: Fri, 27 Jun 2025 19:01:04 +0000 Subject: [PATCH] Update 2 files --- docs/getting-started.md | 78 ++++++++++++++--------------- docs/quick-start.md | 107 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 144 insertions(+), 41 deletions(-) create mode 100644 docs/quick-start.md diff --git a/docs/getting-started.md b/docs/getting-started.md index bb03851d..82c30c38 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -1,74 +1,70 @@ -# Getting Started with SpriteAI +# SpriteAI Quick Start Guide -Welcome to SpriteAI! This guide will walk you through the process of integrating the SpriteAI npm package into your projects. +## Prerequisites + +- Node.js (version 16.0 or higher) +- npm (version 8.0 or higher) ## Installation -To begin using SpriteAI, you'll need to install it in your project directory. Simply run the following command: +Install SpriteAI using npm: ```bash npm install spriteai ``` -## Basic Usage +## Basic Setup -Once SpriteAI is installed, you can start leveraging its powerful features in your project. Here's a quick example demonstrating the main functionalities: +### Importing SpriteAI ```javascript const spriteAI = require('spriteai'); +``` + +## Quick Examples -// Initialise a new SpriteAI instance +### Generate a Basic Sprite + +```javascript const ai = new spriteAI.SpriteAI(); -// Generate a sprite -ai.generateSprite('player', 32, 32) +ai.generateSprite('hero', 32, 32) .then(sprite => { - console.log('Sprite successfully generated:', sprite); + console.log('Hero sprite generated successfully'); }) .catch(error => { - console.error('Sprite generation encountered an error:', error); + console.error('Sprite generation failed:', error); }); +``` + +### Load and Manipulate Sprites +```javascript // Load an existing sprite -ai.loadSprite('path/to/sprite.png') +ai.loadSprite('player.png') .then(sprite => { - console.log('Sprite successfully loaded:', sprite); + // Save modified sprite + return ai.saveSprite(sprite, 'updated_player.png'); }) - .catch(error => { - console.error('Sprite loading encountered an error:', error); - }); - -// Save a sprite -ai.saveSprite(sprite, 'path/to/save/sprite.png') .then(() => { - console.log('Sprite saved successfully'); - }) - .catch(error => { - console.error('Sprite saving encountered an error:', error); + console.log('Sprite processed successfully'); }); ``` -## Key Features - -SpriteAI offers a range of powerful features to enhance your sprite creation and manipulation: - -1. **Sprite Generation**: Utilise `generateSprite(name, width, height)` to programmatically create new sprites. -2. **Sprite Loading**: Easily load existing sprites with `loadSprite(path)`. -3. **Sprite Saving**: Preserve your sprites using `saveSprite(sprite, path)`. - -## Advanced Techniques - -SpriteAI is capable of much more than basic sprite operations. You can create intricate sprite animations, apply various transformations, and unlock a world of creative possibilities. Dive into our comprehensive API documentation to explore the full potential of SpriteAI. - ## Next Steps -To truly master SpriteAI, we recommend: +- Explore advanced sprite generation techniques +- Review full API documentation +- Join our developer community for support + +## Troubleshooting -1. Exploring the full API documentation -2. Experimenting with complex sprite animations -3. Applying different transformations to your sprites -4. Joining our community forums for tips and inspiration +- Ensure you have the latest version of SpriteAI +- Check your Node.js and npm versions +- Review error messages for specific guidance -For in-depth information and advanced usage scenarios, please refer to our extensive API documentation. +## Resources -Thank you for choosing SpriteAI. We're excited to see the amazing sprites you'll create with our package! +- [Full Documentation](/docs) +- [Community Forums](https://spriteai.community) +- [GitHub Repository](https://github.com/spriteai/spriteai) diff --git a/docs/quick-start.md b/docs/quick-start.md new file mode 100644 index 00000000..5b9f6427 --- /dev/null +++ b/docs/quick-start.md @@ -0,0 +1,107 @@ +# Quick Start Guide for SpriteAI + +## Prerequisites + +Before getting started with SpriteAI, ensure you have the following: +- Node.js (version 14.0 or higher) +- npm (Node Package Manager) + +## Installation + +Install SpriteAI in your project using npm: + +```bash +npm install spriteai +``` + +## Basic Usage + +### Initializing SpriteAI + +```javascript +const spriteAI = require('spriteai'); + +// Create a new SpriteAI instance +const ai = new spriteAI.SpriteAI(); +``` + +### Generating Sprites + +Generate a new sprite with a simple command: + +```javascript +ai.generateSprite('player', 32, 32) + .then(sprite => { + console.log('Sprite generated:', sprite); + }) + .catch(error => { + console.error('Sprite generation error:', error); + }); +``` + +### Loading and Saving Sprites + +Load an existing sprite or save a generated one: + +```javascript +// Load a sprite from a file +ai.loadSprite('path/to/sprite.png') + .then(sprite => { + console.log('Sprite loaded successfully'); + + // Save the sprite to a new location + return ai.saveSprite(sprite, 'path/to/save/sprite.png'); + }) + .then(() => { + console.log('Sprite saved successfully'); + }) + .catch(error => { + console.error('Sprite operation failed:', error); + }); +``` + +## Advanced Sprite Generation + +Generate more complex sprites with additional options: + +```javascript +// Generate multiple sprite variations +const variations = await ai.generateSprite('A cartoon robot', { + iterations: 3, + size: '512x512' +}); + +variations.forEach((variation, index) => { + console.log(`Variation ${index + 1}:`, variation); +}); +``` + +## Key Features + +SpriteAI provides powerful features for sprite creation: +- AI-powered sprite generation +- Sprite loading and saving +- Multiple sprite variations +- Advanced transformation capabilities + +## Next Steps + +To dive deeper into SpriteAI: +1. Explore the full API documentation +2. Experiment with sprite transformations +3. Join the community forums for tips and inspiration + +## Troubleshooting + +- Ensure you have the latest version of SpriteAI +- Check your API keys and permissions +- Verify network connectivity for AI-powered generation + +## Support + +For additional help: +- Check our [documentation](https://spriteai.com/docs) +- Join our [community forums](https://spriteai.com/community) +- Contact support at support@spriteai.com + +## Happy Sprite Creating! 🎨🤖 \ No newline at end of file