Merge pull request #1996 from Nykakin/texture_horizontal_flip

created method flip_horizontal() for kivy.graphics.texture.Texture
This commit is contained in:
Akshay Arora 2014-03-30 19:49:22 +05:30
commit c75ab3f5fd
2 changed files with 7 additions and 0 deletions

View File

@ -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)

View File

@ -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.'''