diff --git a/kivy/graphics/texture.pxd b/kivy/graphics/texture.pxd index 82e474027..8ea9b6270 100644 --- a/kivy/graphics/texture.pxd +++ b/kivy/graphics/texture.pxd @@ -37,6 +37,7 @@ cdef class Texture: cdef void allocate(self) cpdef flip_vertical(self) + cpdef flip_horizontal(self) cpdef get_region(self, x, y, width, height) cpdef bind(self) diff --git a/kivy/graphics/texture.pyx b/kivy/graphics/texture.pyx index c492e3653..ab8118a06 100644 --- a/kivy/graphics/texture.pyx +++ b/kivy/graphics/texture.pyx @@ -731,6 +731,12 @@ cdef class Texture: self._uvh = -self._uvh self.update_tex_coords() + cpdef flip_horizontal(self): + '''Flip tex_coords for horizontal display.''' + self._uvx += self._uvw + self._uvw = -self._uvw + self.update_tex_coords() + cpdef get_region(self, x, y, width, height): '''Return a part of the texture defined by the rectangular arguments (x, y, width, height). Returns a :class:`TextureRegion` instance.'''