KIVY image placement

19 views Asked by At

I am trying to place this image in the bottom left corner the KIVY origin. It shows up in the centre. Can someone help me? Buttons at pos 0,0 show up in the bottom left corner as expected.

from kivy.app import App
from kivy.uix.floatlayout import FloatLayout
from kivy.uix.button import Button
from kivy.uix.image import Image


class CustomGUI(FloatLayout):
    def __init__(self, **kwargs):
        super(CustomGUI, self).__init__(**kwargs)
        # Create a button with size 300x300 pixels
        self.logo = Image(source='kivy-deps-build/Assets/SAFEBOT_LOGO.png', size=(355, 178))
        # Position the button at the bottom left corner
        self.logo.pos = (0, 0)
        self.add_widget(self.logo)

class MyApp(App):
    def build(self):
        return CustomGUI()

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

This example

from kivy.app import App
from kivy.uix.floatlayout import FloatLayout
from kivy.uix.button import Button
from kivy.uix.image import Image


class CustomGUI(FloatLayout):
    def __init__(self, **kwargs):
        super(CustomGUI, self).__init__(**kwargs)
        # Create a button with size 300x300 pixels
        self.logo = Image(source='kivy-deps-build/Assets/SAFEBOT_LOGO.png', size=(355, 178))
        # Position the button at the bottom left corner
        self.logo.pos = (0, 0)
        self.add_widget(self.logo)

class MyApp(App):
    def build(self):
        return CustomGUI()

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

0

There are 0 answers