renpy / pygame_sdl2

Reimplementation of portions of the pygame API using SDL2.
GNU Lesser General Public License v2.1
326 stars 64 forks source link

Add an optional rectangle parameter to TextureNode. #95

Closed MyreMylar closed 6 years ago

MyreMylar commented 6 years ago

So that users can specify their own area of a shared Texture to use. This allows more flexibility rather than having this functionality restricted to the TextureAtlas class which is specific to one particular approach to texture sharing.

As an example, I've used this to make a better custom image loader for PyTMX tiles loaded from the Tiled editor so that rather than having 100 or so tiny 64x64 pixel textures their tilesets could each be on one texture.

(This is my first attempt at mastering the git pull request workflow, so apologies if I've messed something up or it's too simple. I just wanted to try something relatively straightforward.)

MyreMylar commented 6 years ago

Apparently you have to be very careful when making use of the GitHub web interface to edit files.

Please ignore all those reverted commits where I'm editing the readme. I've basically discovered why people use branches to do everything in git. It's so independent changes don't appear to be dependent on one another.