Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/lioncat2002/pylcanim

A simple library for playing animations made with sprite factory
https://github.com/lioncat2002/pylcanim

animation library pygame python python-3 python3 sprite-animation

Last synced: 22 days ago
JSON representation

A simple library for playing animations made with sprite factory

Awesome Lists containing this project

README

        

# pylcanim


pylcanim is a simple library for playing animations made with sprite factory

(https://github.com/craftworkgames/SpriteFactory)

## Installation of pylcanim library

To install from pypi with pip
```
pip install pylcanim
```
## Downloading SpriteFactory


You can directly download the executable(note: At this point this is windows only).

From: https://craftworkgames.itch.io/sprite-factory

Or build it yourself

From: https://github.com/craftworkgames/SpriteFactory

## Using SpriteFactory


You can see this video https://youtu.be/mSakKpmBjrg (time stamp in description).

## Using the library

import the pylcanim into your project with

```py
from pylcanim import pylcanim
```
Then initialize the library with
```py
pylcanim.init('Path/To/Your/SpriteFactoryFile.sf')

```

In your main loop write
```py
image=pylcanim.lcAnim(fpscount,row)
```
Where
```
fpscount is an integer which determines how fast your animation should run(0 is fastest and becomes slower increasingly)
```
and
```
row is the row number in which your sprite is situated(default=0 for single line spritesheets)
```
## An entire Example

```py
import pygame
from pylcanim import pylcanim as p

(width,height)=(300,200)
clock=pygame.time.Clock()
screen=pygame.display.set_mode((width,height))
pygame.display.flip()
running=True
p.init('run.sf')
while running:
image =p.lcAnim(3,0)
for event in pygame.event.get():
if event.type==pygame.QUIT:

running=False
screen.fill((255, 255, 255))
screen.blit(image, (0, 50))
pygame.display.update()

clock.tick(60)
pygame.quit()

```