From 1ff83939d701dce230ea46fdf10d0834bbe9f8f7 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Mon, 28 Oct 2013 16:57:25 +0100 Subject: [PATCH] Add docs for trans --- tmxlib/image.py | 10 ++++++++-- tmxlib/image_base.py | 8 +++++++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/tmxlib/image.py b/tmxlib/image.py index 067bfc2..e955ae1 100644 --- a/tmxlib/image.py +++ b/tmxlib/image.py @@ -30,8 +30,14 @@ def open(filename, trans=None, size=None): :param filename: Name of the file to load the image from :param trans: - Optional color that should be rendered as transparent - (this is not implemented yet) + Optional color that should be loaded as transparent + + .. note:: + + Currently, loading images that use color-key transparency + is very inefficient. + If possible, use the alpha channel instead. + :param size: Optional (width, height) tuple. If specified, the file will not be read from disk when the image size diff --git a/tmxlib/image_base.py b/tmxlib/image_base.py index e4156bb..663d1ac 100644 --- a/tmxlib/image_base.py +++ b/tmxlib/image_base.py @@ -106,7 +106,13 @@ class Image(ImageBase, fileio.ReadWriteBase): .. attribute:: trans - A color key used for transparency (currently not implemented) + A color key used for transparency + + .. note:: + + Currently, loading images that use color-key transparency + is very inefficient. + If possible, use the alpha channel instead. Images support indexing (``img[x, y]``); see :meth:`tmxlib.image_base.ImageBase.__getitem__`