From 8ddbcb4f0038a7b0e7a81117abee1df37eba47b7 Mon Sep 17 00:00:00 2001 From: Marisuz Obajtek Date: Fri, 21 Mar 2014 15:38:10 +0100 Subject: [PATCH] created method flip_horizontal() for kivy.graphics.texture.Texture --- kivy/graphics/texture.pxd | 1 + kivy/graphics/texture.pyx | 6 ++++++ 2 files changed, 7 insertions(+) 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.'''