Skip to content

Add Quick Start Guide for SpriteAI Documentation #429

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
71 changes: 38 additions & 33 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
@@ -1,74 +1,79 @@
# 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 14.0.0 or higher)
- npm package manager

## 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:
Import SpriteAI into your project:

```javascript
const spriteAI = require('spriteai');

// Initialise a new SpriteAI instance
// Initialize SpriteAI
const ai = new spriteAI.SpriteAI();
```

## Core Functions

### Generate a Sprite

// Generate a sprite
```javascript
ai.generateSprite('player', 32, 32)
.then(sprite => {
console.log('Sprite successfully generated:', sprite);
console.log('Sprite generated successfully');
})
.catch(error => {
console.error('Sprite generation encountered an error:', error);
console.error('Sprite generation failed', error);
});
```

// Load an existing sprite
### Load an Existing Sprite

```javascript
ai.loadSprite('path/to/sprite.png')
.then(sprite => {
console.log('Sprite successfully loaded:', sprite);
console.log('Sprite loaded successfully');
})
.catch(error => {
console.error('Sprite loading encountered an error:', error);
console.error('Sprite loading failed', error);
});
```

### Save a Sprite

// Save a sprite
```javascript
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.error('Sprite saving failed', error);
});
```

## 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.
## Recommended Next Steps

## Next Steps
1. Explore advanced sprite generation techniques
2. Review full API documentation
3. Experiment with sprite transformations

To truly master SpriteAI, we recommend:
## 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 installed
- Check your Node.js version compatibility
- Verify file paths when loading or saving sprites

For in-depth information and advanced usage scenarios, please refer to our extensive API documentation.
## Support

Thank you for choosing SpriteAI. We're excited to see the amazing sprites you'll create with our package!
If you encounter any issues, please visit our support forum or file an issue on our GitHub repository.
108 changes: 108 additions & 0 deletions docs/quick-start.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
# Quick Start Guide for SpriteAI

## Prerequisites

Before getting started with SpriteAI, ensure you have the following:
- Node.js (version 14.0 or later)
- npm (Node Package Manager)

## Installation

Install SpriteAI in your project using npm:

```bash
npm install spriteai
```

## Basic Usage

### Initializing SpriteAI

Start by importing the SpriteAI module in your JavaScript project:

```javascript
const spriteAI = require('spriteai');

// Create a new SpriteAI instance
const ai = new spriteAI.SpriteAI();
```

### Generating Sprites

Generate a new sprite with a simple method call:

```javascript
ai.generateSprite('player', 32, 32)
.then(sprite => {
console.log('Sprite generated successfully:', sprite);
})
.catch(error => {
console.error('Sprite generation error:', error);
});
```

### Loading and Saving Sprites

Easily load and save sprite images:

```javascript
// Load an existing sprite
ai.loadSprite('path/to/sprite.png')
.then(sprite => {
console.log('Sprite loaded:', sprite);

// Save the sprite
return ai.saveSprite(sprite, 'path/to/save/sprite.png');
})
.then(() => {
console.log('Sprite saved successfully');
})
.catch(error => {
console.error('Sprite operation error:', error);
});
```

## Advanced Sprite Generation

Generate more complex sprites with additional options:

```javascript
// Generate a pixel art character sprite
const pixelArtSprite = await spriteAI.generatePixelArt('A pixelated robot warrior', {
save: true, // Automatically save the generated sprite
iterations: 3 // Generate multiple variations
});
```

## Key Features

SpriteAI provides powerful capabilities:
- AI-powered sprite generation
- Sprite loading and saving
- Pixel art creation
- Multiple sprite variations
- Advanced transformation methods

## Next Steps

To dive deeper into SpriteAI:
1. Explore the full API documentation
2. Experiment with sprite transformations
3. Join our community forums for tips and inspiration

## Troubleshooting

- Ensure you have the latest version of SpriteAI installed
- Check that your API keys are correctly configured
- Review the error messages for specific guidance

## Support

For additional help:
- Visit our documentation website
- Check out the GitHub repository
- Join our community Discord channel

## License

SpriteAI is released under the MIT License. See LICENSE file for details.