Closed mgedmin closed 3 years ago
Libtcod's image object has some dynamic internal stuff which makes it hard to port properly.
Image.put_pixel
is not an alternative to tcod.image_load
. put_pixel
would be deprecated itself if Image
had an accessible pixel buffer array. If you need to use an Image
object then ignore the warning in tcod.image_load
.
The long-term plan is to have functions return and accept NumPy arrays instead of Image
.
Ah, I wondered why many objects had numpy arrays but not Image.
My goal was to take the TCOD Tutorial code and make it run without warnings with the latest python-tcod. I now see that that is impossible. :(
I've added some new functions in the latest version (11.4.0). With tcod.image.load
and Console.draw_semigraphics
you should be able to avoid the Image
class and the related libtcodpy functions.
Using
produces a PendingDeprecationWarning: This function may be deprecated in the future. Consider raising an issue on GitHub if you need this feature.
I was unable to find any replacement for this function. Constructing a new image and setting its data by repeated calls to Image.put_pixel() does not seem reasonable (plus I don't wish to write my own PNG loader).