I’m not sure but is this what you want?
from kivy.config import Config
Config.set('modules', 'showborder', '')
from kivy.app import App
from kivy.lang import Builder
from kivy.factory import Factory as F
class MyScatter(F.Scatter):
pass
Builder.load_string('''
<MyScatter>:
scale: 1
do_scale: True
do_translation: True
do_rotation: False
size_hint: None, None
size: img.size
auto_bring_to_front: False
Image:
id: img
source: 'data/logo/kivy-icon-256.png'
# size_hint: (0.43, 0.6)
# pos_hint: {'center_x': 0.33, 'center_y': 0.5}
keep_ratio: True
size: self.texture.size if self.texture else (0, 0)
''')
class MyApp(App):
def build(self):
mainbox = F.FloatLayout()
self.ms = MyScatter()
mainbox.add_widget(self.ms)
mainbox.add_widget(F.Button(text="Fwd",
font_size="17dp",
size_hint=(.075, .15),
pos_hint={"left":1,
"center_y":0.5},
on_press=print))
return mainbox
MyApp().run()
CLICK HERE to find out more related problems solutions.