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: about 1 year ago
JSON representation
A simple library for playing animations made with sprite factory
- Host: GitHub
- URL: https://github.com/lioncat2002/pylcanim
- Owner: Lioncat2002
- License: mit
- Created: 2020-12-12T11:33:34.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2020-12-24T07:16:09.000Z (over 5 years ago)
- Last Synced: 2025-02-23T09:39:11.167Z (over 1 year ago)
- Topics: animation, library, pygame, python, python-3, python3, sprite-animation
- Language: Python
- Homepage:
- Size: 43 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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()
```