Skip to content

Add Quick Start Guide to Documentation for SpriteAI #441

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 37 additions & 41 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
@@ -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)
107 changes: 107 additions & 0 deletions docs/quick-start.md
Original file line number Diff line number Diff line change
@@ -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! 🎨🤖