File: image_mipmap.py

package info (click to toggle)
kivy 2.3.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 35,316 kB
  • sloc: python: 80,678; ansic: 5,326; javascript: 780; objc: 725; lisp: 195; sh: 173; makefile: 150
file content (31 lines) | stat: -rw-r--r-- 797 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
'''
Image mipmap
============

Difference between a mipmapped image and no mipmap image.
The lower image is normal, and the top image is mipmapped.
'''

import kivy
kivy.require('1.0.7')

from kivy.app import App
from kivy.uix.scatter import ScatterPlane
from kivy.uix.image import Image
from os.path import join


class LabelMipmapTest(App):
    def build(self):
        s = ScatterPlane(scale=.5)
        filename = join(kivy.kivy_data_dir, 'logo', 'kivy-icon-256.png')
        l1 = Image(source=filename, pos=(400, 100), size=(256, 256))
        l2 = Image(source=filename, pos=(400, 356), size=(256, 256),
                   mipmap=True)
        s.add_widget(l1)
        s.add_widget(l2)
        return s


if __name__ == '__main__':
    LabelMipmapTest().run()