mirror of https://github.com/kivy/kivy.git
Merge pull request #1996 from Nykakin/texture_horizontal_flip
created method flip_horizontal() for kivy.graphics.texture.Texture
This commit is contained in:
commit
c75ab3f5fd
|
@ -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)
|
||||
|
||||
|
|
|
@ -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.'''
|
||||
|
|
Loading…
Reference in New Issue