Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tshirtman/loaders.py
a set of loading functions/classes to use with pygame projects
https://github.com/tshirtman/loaders.py
Last synced: about 1 month ago
JSON representation
a set of loading functions/classes to use with pygame projects
- Host: GitHub
- URL: https://github.com/tshirtman/loaders.py
- Owner: tshirtman
- License: mit
- Created: 2011-02-04T23:12:06.000Z (almost 14 years ago)
- Default Branch: master
- Last Pushed: 2014-11-14T22:14:02.000Z (about 10 years ago)
- Last Synced: 2024-10-27T07:24:29.790Z (about 2 months ago)
- Language: Python
- Homepage:
- Size: 141 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README
- License: LICENSE.txt
Awesome Lists containing this project
README
ABSTRACT
========pygame_loaders is a set of classes/functions, to use mainly for image
loadings/processing with pygame, it uses memoization to accelerate successive
loadings of images, and repeating the same process on the same images, acting
as a real cache for image loading and manipulations, it help to load tracks and
such too.This module was originaly a simple syntaxic sugar for a pygame project,
for performances sake it quickly gained memoization, allowing you to call for
images, not carring if you already loaded them or not. As you may need to do
that for result of process on those images, the image loader gained a lot of
keywords, that allow to call images with a zooms, blending, reversing, scaling,
rotating, and all sort of combinations, everytime doing only the required parts
of those processings, and using previous results of processings. Okay, it can
takes up big memory amounts, but well, i found it's most of the time less of
the problem than CPU, so if you agree, you will probably agree that for games,
it's an acceptable tradeoff.Oh, for convenience sakes, it can load bunch of text and musics, too, the
processing part is less developped on these ones, but contributions are
welcomed, and memoization is done for them too.Anyway, using it is quite simple, simply import the needed loaders from
loaders.py, and for an image filepath, image() will return a tupple containing
the image and it's size, no need to store it away, calling the loader a second
time or more is basically free, thanks to memoization.pygame must be loaded and display_mode set to perform most image operations.
>>> from pygame_loaders import image
>>> image('myimage.png') # actual loading
(, )>>> image('myimage.png') # returning same result, without any loading
>>> image("myimage.png", zoom=1.5) # only performing zoom
(, )>>> image("myimage.png", zoom=1.5, alpha=0.4) # only changing alpha
(, )INSTALL
=======you can simply copy the library to your application sources, or use setup.py to install (python setup.py install)
it is also disponible in the cheesechop (pypi.python.org) so you can easy_install or pip install it.