Skip to content

Commit 8835590

Browse files
committed
How to Check the Size of Ellipse Objects with Python Kivy
How to Check the Size of Ellipse Objects with Python Kivy
1 parent ecc2f15 commit 8835590

File tree

8 files changed

+124
-0
lines changed

8 files changed

+124
-0
lines changed

.idea/.gitignore

+3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/.name

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/inspectionProfiles/Project_Default.xml

+22
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/inspectionProfiles/profiles_settings.xml

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

+4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/python____project.iml

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

main.py

+72
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
from kivy.app import App
2+
from kivy.lang import Builder
3+
4+
kv = '''
5+
BoxLayout:
6+
orientation: 'vertical'
7+
BoxLayout:
8+
size_hint_y: None
9+
height: sp(100)
10+
BoxLayout:
11+
orientation: 'vertical'
12+
Slider:
13+
id: e1
14+
min: -360.
15+
max: 360.
16+
Label:
17+
text: 'angle_start = {}'.format(e1.value)
18+
BoxLayout:
19+
orientation: 'vertical'
20+
Slider:
21+
id: e2
22+
min: -360.
23+
max: 360.
24+
value: 360
25+
Label:
26+
text: 'angle_end = {}'.format(e2.value)
27+
28+
BoxLayout:
29+
size_hint_y: None
30+
height: sp(100)
31+
BoxLayout:
32+
orientation: 'vertical'
33+
Slider:
34+
id: wm
35+
min: 0
36+
max: 2
37+
value: 1
38+
Label:
39+
text: 'Width mult. = {}'.format(wm.value)
40+
BoxLayout:
41+
orientation: 'vertical'
42+
Slider:
43+
id: hm
44+
min: 0
45+
max: 2
46+
value: 1
47+
Label:
48+
text: 'Height mult. = {}'.format(hm.value)
49+
Button:
50+
text: 'Reset ratios'
51+
on_press: wm.value = 1; hm.value = 1
52+
53+
FloatLayout:
54+
canvas:
55+
Color:
56+
rgb: 1, 1, 1
57+
Ellipse:
58+
pos: 100, 100
59+
size: 200 * wm.value, 201 * hm.value
60+
source: 'data/logo/kivy-icon-512.png'
61+
angle_start: e1.value
62+
angle_end: e2.value
63+
64+
'''
65+
66+
67+
class CircleApp(App):
68+
def build(self):
69+
return Builder.load_string(kv)
70+
71+
72+
CircleApp().run()

0 commit comments

Comments
 (0)