from kivy.app import App
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.button import Button
from kivy.uix.label import Label
from kivy.uix.screenmanager import ScreenManager, Screen
from kivy.animation import Animation
from kivy.clock import Clock
from kivy.config import Config
from kivy.uix.floatlayout import FloatLayout
from kivy.uix.image import Image
from kivy.core import audio
from kivy.core.audio import SoundLoader
from kivy.uix.widget import Widget
import time
#import socket
#sock = socket.socket()
#sock.bind(('', 9090))
#sock.listen(1)
Config.set('graphics', 'resizable', '0')
Config.set('graphics', 'width', '500')
Config.set('graphics', 'height', '500')
class MainApp(App):
def build(self):
self.title = 'project123'
main_layout = FloatLayout()
# Label
name=Label(text ='lbl', font_size='15sp', size_hint =(.5,.5), pos_hint = {'center_x': .5, 'center_y': .5})
main_layout.add_widget(name)
"""
wid= Widget(size=(.5, .5), pos=(.5, .5))
wid2 = Widget(size=(.5, .5), pos=(.5, .5))
main_layout.add_widget(wid)
main_layout.add_widget(wid2)
while True:
time.sleep(0.6)
if wid.collide_widget(wid2):
print("col")"""
wid = Image(source='man1.png', pos=(.5,.5), color=(.1,.1,.1, 0.5))
wid2 = Image(source='man1.png', pos=(.5,.5), color=(.1,.1,.1, 1))
while True:
time.sleep(0.6)
if wid.collide_widget(wid2):
print("col1")
# CODE
return main_layout
# DEFS
if __name__ == '__main__':
app = MainApp()
app.run()
from kivy.app import App
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.button import Button
from kivy.uix.label import Label
from kivy.uix.screenmanager import ScreenManager, Screen
from kivy.animation import Animation
from kivy.clock import Clock
from kivy.config import Config
from kivy.uix.floatlayout import FloatLayout
from kivy.uix.image import Image
from kivy.core import audio
from kivy.core.audio import SoundLoader
from kivy.uix.widget import Widget
import time
#import socket
#sock = socket.socket()
#sock.bind(('', 9090))
#sock.listen(1)
Config.set('graphics', 'resizable', '0')
Config.set('graphics', 'width', '500')
Config.set('graphics', 'height', '500')
class MainApp(App):
def build(self):
self.title = 'project123'
main_layout = FloatLayout()
# Label
name=Label(text ='lbl', font_size='15sp', size_hint =(.5,.5), pos_hint = {'center_x': .5, 'center_y': .5})
main_layout.add_widget(name)
"""
wid= Widget(size=(.5, .5), pos=(.5, .5))
wid2 = Widget(size=(.5, .5), pos=(.5, .5))
main_layout.add_widget(wid)
main_layout.add_widget(wid2)
while True:
time.sleep(0.6)
if wid.collide_widget(wid2):
print("col")"""
wid = Image(source='man1.png', pos=(.5,.5), color=(.1,.1,.1, 0.5))
wid2 = Image(source='man1.png', pos=(.5,.5), color=(.1,.1,.1, 1))
main_layout.add_widget(wid)
main_layout.add_widget(wid2)
if wid.collide_widget(wid2):
print("col1")
return main_layout
if __name__ == '__main__':
app = MainApp()
app.run()