Skip to content

Instantly share code, notes, and snippets.

@kived
Created March 15, 2015 01:17
Show Gist options
  • Save kived/7962bd09b5cf6c8eb2a1 to your computer and use it in GitHub Desktop.
Save kived/7962bd09b5cf6c8eb2a1 to your computer and use it in GitHub Desktop.
Kivy: tex_coords
import kivy
kivy.require('1.8.1')
from kivy.app import App
from kivy.lang import Builder
root = Builder.load_string('''
BoxLayout:
Widget:
canvas:
Color:
rgba: 1, 1, 1, 1
Rectangle:
source: 'examples/kv/kivy.jpg'
pos: self.pos
size: 100, 100
Widget:
canvas:
Color:
rgba: 1, 1, 1, 1
Rectangle:
source: 'examples/kv/kivy.jpg'
pos: self.pos
size: 100, 100
tex_coords: 0.3, 0.7, 0.7, 0.7, 0.7, 0.3, 0.3, 0.3
''')
class TestApp(App):
def build(self):
return root
if __name__ == '__main__':
TestApp().run()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment