Showing posts with label loader. Show all posts
Showing posts with label loader. Show all posts

October 23, 2011

B.V First Class(es)

Hi, here are some classes, that I finished during the week.

SourceLoader class load my resources from a directory or just one specific resource. Use MassSourceLoader to load sound, text and images from a directory and from its subdirectories. If something went wrong the ErrorLogger class give you a feedback. Use OpenTxt, OpenWav and OpenImage methods to load a single source.


SplitSheet class to split my spritesheets. Give the source image and the width and hight of one sprite on the sheet and the class return an image list, where every element is an individual image, use Images[x] to get them


ErrorLogger class to log errors that occure during the source loading or other activity. If something get wrong you can find an ErrorLog.txt on your work directory with some information about the error.


Thats for now, next week I will share more, I hope, finished classes.

September 23, 2011

Refactorization

To ease my future work I refactorized my previous Button and Entry class that I used it the image browser project, and made one Interface class from them. Much more simple. Beside some refactorization I created a resource loader, it will be great help at next Pyweek. You can load images, text files and sound into a dictionary which grant easy access to resources. I wrote a small code to demonstrate their work. They are under GNU licence, so feel free to download them from here.