I'm making a game and I need to blit my objects inside the area of a specific image. I don't want to need my surface to blit these images. Is it possible? (I'm using pygame)
相关问题
- Views base64 encoded blob in HTML with PHP
- how to define constructor for Python's new Nam
- streaming md5sum of contents of a large remote tar
- How to get the background from multiple images by
- Evil ctypes hack in python
It would be better in the future if you would explain what you are trying to do a bit better since it would give you more answers :)
From what I have understood you want to blit an image onto another image:
For this code to work the following premises are set:
I have written the following piece of code which you can run if you follow the above premises:
Images are just surfaces with a sprite or picture on. The coordinate system of a surface always starts at the upper left (0,0), which is why (0,0) of image1 isn't the same as the (0,0) of screen.
I took a picture of the program and edited some arrows in to explain my point:
Hope this was a help and remember to accept as the answer if you find it acceptable :)