本文整理汇总了Python中kivy.uix.screenmanager.Screen.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Screen.__init__方法的具体用法?Python Screen.__init__怎么用?Python Screen.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kivy.uix.screenmanager.Screen
的用法示例。
在下文中一共展示了Screen.__init__方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from kivy.uix.screenmanager import Screen [as 别名]
# 或者: from kivy.uix.screenmanager.Screen import __init__ [as 别名]
def __init__(self, name=""):
Screen.__init__(self, name=name)
self.layout = FloatLayout()
self.color = Label(text="Pick a Color or Animation",
pos_hint={'x': 0, 'y': .67},
size_hint=(1, .33),
font_size=32)
self.animations = Button(text="Pick Animation",
pos_hint={'x': 0, 'y': .34},
size_hint=(1, .33),
font_size=32)
self.sliders = Button(text="Custom Color",
pos_hint={'x': 0, 'y': 0},
size_hint=(.5, .34),
font_size=32)
self.main = Button(text="Return",
pos_hint={'x': .5, 'y': 0},
size_hint=(.5, .34),
font_size=32)
self.main.bind(on_release=self.go_to_main)
self.sliders.bind(on_release=self.go_to_sliders)
self.animations.bind(on_release=self.go_to_anims)
self.layout.add_widget(self.color)
self.layout.add_widget(self.animations)
self.layout.add_widget(self.sliders)
self.layout.add_widget(self.main)
self.add_widget(self.layout)
示例2: __init__
# 需要导入模块: from kivy.uix.screenmanager import Screen [as 别名]
# 或者: from kivy.uix.screenmanager.Screen import __init__ [as 别名]
def __init__(self):
Screen.__init__(self)
self.name = 'file'
self.file_chooser = FileChooserListView(path=os.getcwd())
self.file_chooser.bind(on_submit=self.add_cards)
self.add_widget(self.file_chooser)
示例3: __init__
# 需要导入模块: from kivy.uix.screenmanager import Screen [as 别名]
# 或者: from kivy.uix.screenmanager.Screen import __init__ [as 别名]
def __init__(self, **kwargs):
Screen.__init__(self, **kwargs)
main = BoxLayout(orientation="vertical")
main.add_widget(ActionBar(size_hint=(1, .125)))
carousel = Carousel(direction='right')
layout = GridLayout(rows=2)
i, c = 0, 0
for card in self.definition.cards(App.get_running_app().achievements,
use_blocks=False):
color = (1, 1, 1, 1)
if str(card) in self.definition.blocked_cards:
color = (.5, 0, 0, 1)
layout.add_widget(CardSelect(card=card,
color=color,
callback=self._card_detail,
args=(card,)))
i += 1
c += 1
if i == 10:
carousel.add_widget(layout)
layout = GridLayout(rows=2)
i = 0
if c < 50 + len(self.definition.specials):
layout.add_widget(CardSelect(card=self.LOCKED_CARD))
carousel.add_widget(layout)
main.add_widget(carousel)
self.add_widget(main)
示例4: __init__
# 需要导入模块: from kivy.uix.screenmanager import Screen [as 别名]
# 或者: from kivy.uix.screenmanager.Screen import __init__ [as 别名]
def __init__(self, **kwargs):
Screen.__init__(self, **kwargs)
self.layout = BoxLayout()
# self.btnQuit = Button(text='Quit now!',on_press=app.quitApp)
# self.add_widget(self.btnQuit)
# Add your code below to add the two Buttons
pass
示例5: __init__
# 需要导入模块: from kivy.uix.screenmanager import Screen [as 别名]
# 或者: from kivy.uix.screenmanager.Screen import __init__ [as 别名]
def __init__(self, player_file=None, **kwargs):
Screen.__init__(self, **kwargs)
self.purchased = []
if player_file is None:
self._purchased_file = os.path.join("player", "backgrounds.txt")
else: self._purchased_file = player_file
self._read_purchased()
self.purchased_cat = BackgroundCategory('Purchased')
self.categories = []
self._available_file = os.path.join("data", "Backgrounds.txt")
self._read_available()
layout = BoxLayout(orientation="vertical")
layout.add_widget(ActionBar(size_hint=(1, .125)))
scroller = ScrollView(do_scroll_x=False)
self.grid = GridLayout(cols=1, size_hint_y=None)
self.grid.add_widget(CategoryIcon(screen=self,
category=self.purchased_cat))
self.bind(size=self._resize_grid)
for cat in self.categories:
self.grid.add_widget(CategoryIcon(screen=self,
category=cat))
scroller.add_widget(self.grid)
layout.add_widget(scroller)
self.add_widget(layout)
示例6: __init__
# 需要导入模块: from kivy.uix.screenmanager import Screen [as 别名]
# 或者: from kivy.uix.screenmanager.Screen import __init__ [as 别名]
def __init__(self,**kwargs):
Screen.__init__(self,**kwargs)
self.log = kwargs['log']
self.status_display = None
self.display_limit = 100
self.visible = False
示例7: __init__
# 需要导入模块: from kivy.uix.screenmanager import Screen [as 别名]
# 或者: from kivy.uix.screenmanager.Screen import __init__ [as 别名]
def __init__(self, **kwargs):
Screen.__init__(self, **kwargs)
self.tryout = StackLayout(orientation ='lr-bt')
self.floatt = FloatLayout()
#variable for gettinginformation()
self.counter = 0
# Title of the screen
self.floatt.add_widget(Label(text='[color=000000][size=40][font=yorkwhiteletter]EBOTS INFORMATION[/font][/size][/color]', size_hint=(0.5,0.2),markup=True,pos_hint={'x':0.05,'y':0.8}))
#information on ebots with 'good' status
self.ebotgoodpic = Image(source='C:\Users\The Gt Zan\Pictures\ebotinfo.PNG')
self.floatt.add_widget(self.ebotgoodpic)
#buttons at the bottom
self.switchtomenu = Button(text='[size=50][font=yorkwhiteletter][color=000000]MENU[/font][/size][/color]',markup=True, size_hint=(0.2,0.2),background_color=(1,1,1,0),on_press=self.changeToMenu)
self.switchtoebot = Button(text='[size=50][font=yorkwhiteletter][color=000000]EBOTS[/font][/size][/color]', markup=True,size_hint=(0.2,0.2),background_color=(1,1,1,0),on_press=self.changeToebots)
self.switchtopersonal = Button(text='[size=50][font=yorkwhiteletter][color=000000]INDIVIDUAL[/font][/size][/color]', markup=True,size_hint=(0.2,0.2),background_color=(1,1,1,0),on_press=self.changeToPersonal)
self.tryout.add_widget(self.switchtoebot)
self.tryout.add_widget(self.switchtopersonal)
self.tryout.add_widget(self.switchtomenu)
#getting information
self.refresh=Button(text='[size=50][font=yorkwhiteletter][color=000000]REFRESH[/font][/size][/color]', markup = True, size_hint=(0.2,0.2),background_color=(1,1,1,0),on_press=self.gettinginformation)
self.tryout.add_widget(self.refresh)
#add layouts
self.add_widget(self.tryout)
self.add_widget(self.floatt)
示例8: __init__
# 需要导入模块: from kivy.uix.screenmanager import Screen [as 别名]
# 或者: from kivy.uix.screenmanager.Screen import __init__ [as 别名]
def __init__(self, title, *args, **kwargs):
"""
@title - tytul (nazwa) cwiczenia
"""
Builder.load_file("kv/genericlevels.kv")
Screen.__init__(self, *args, **kwargs)
self.title = title
示例9: __init__
# 需要导入模块: from kivy.uix.screenmanager import Screen [as 别名]
# 或者: from kivy.uix.screenmanager.Screen import __init__ [as 别名]
def __init__(self, **kwargs):
Screen.__init__(self, **kwargs)
# Prepare the display areas
self.gameboard = BoardDisplay(board=self.game.board,
size_hint=(4, 1))
self.round_counter = RoundCounter(round_number=self.game.round,
max_round=GameSettings.NUM_ROUNDS,
size_hint=(1, .075))
self.scoreboard = ScoreDisplay(scoreboard=self.game.score,
size_hint=(1, .4))
self.tooltip = ToolTipDisplay(size_hint=(1, .5))
self.hand_display = HandDisplay(hand=self.game.players[PLAYER],
size_hint=(1, .3))
# Lay out the display
main = BoxLayout(orientation="vertical")
layout = BoxLayout()
layout.add_widget(self.gameboard)
sidebar = BoxLayout(orientation="vertical")
sidebar.add_widget(self.round_counter)
sidebar.add_widget(self.scoreboard)
sidebar.add_widget(self.tooltip)
layout.add_widget(sidebar)
main.add_widget(layout)
main.add_widget(self.hand_display)
self.add_widget(main)
示例10: __init__
# 需要导入模块: from kivy.uix.screenmanager import Screen [as 别名]
# 或者: from kivy.uix.screenmanager.Screen import __init__ [as 别名]
def __init__(self, n_procesadores, **kwargs):
Builder.load_file(kwargs['archivo'])
Screen.__init__(self, **kwargs)
self.procesadores = None
self.tabla_procesos = None
self.popup_proceso = None
self.inicializar(n_procesadores)
self.tabla_procesos = self.tabla_procesos or TablaProcesosGUI(self.sistema.procesos)
self.procesadores = self.procesadores or [ProcesadorGUI(p, self.tabla_procesos) for p in self.sistema.procesadores]
self.popup_proceso = self.popup_proceso or ProcesoPopup(self.sistema)
self.ids.titulo.text = "Simulacion para "+self.name
self.popup_recurso = RecursoPopup(self.sistema)
self.tabla_recursos = TablaRecursosGUI(self.sistema.recursos)
self.ejecutando = False
self.paso = False
for p in self.procesadores:
self.ids.procesadores.add_widget(p)
self.c_procesos.add_widget(self.tabla_procesos)
self.c_recursos.add_widget(self.tabla_recursos)
self.sistema.asignar_vista(self)
示例11: __init__
# 需要导入模块: from kivy.uix.screenmanager import Screen [as 别名]
# 或者: from kivy.uix.screenmanager.Screen import __init__ [as 别名]
def __init__(self, **kwargs):
Screen.__init__(self, **kwargs)
layout = BoxLayout(orientation="vertical")
layout.add_widget(ActionBar(size_hint=(1, .125)))
settings = SettingsWithNoMenu(size_hint=(1, .875))
App.get_running_app().build_settings(settings)
layout.add_widget(settings)
self.add_widget(layout)
示例12: __init__
# 需要导入模块: from kivy.uix.screenmanager import Screen [as 别名]
# 或者: from kivy.uix.screenmanager.Screen import __init__ [as 别名]
def __init__(self, **kwargs):
Screen.__init__(self, **kwargs)
layout = BoxLayout(orientation="vertical")
layout.add_widget(ActionBar(size_hint=(1, .125)))
self.main = StatisticsDisplay(statistics=self.statistics,
deck=App.get_running_app().loaded_deck)
layout.add_widget(self.main)
self.add_widget(layout)
示例13: __init__
# 需要导入模块: from kivy.uix.screenmanager import Screen [as 别名]
# 或者: from kivy.uix.screenmanager.Screen import __init__ [as 别名]
def __init__(self, name="", custom_manager=None):
Screen.__init__(self, name=name)
self.current_page = 1
self.obd_manager = custom_manager
self.layout = FloatLayout()
self.values = [Label(text="OBD", size_hint=(.5, .30), pos_hint={'x': 0, 'y': .6}, font_size=32),
Label(text="OBD2", size_hint=(.5, .30),
pos_hint={'x': .5, 'y': .6}, font_size=32),
Label(text="OBD3", size_hint=(.5, .30),
pos_hint={'x': 0, 'y': .20}, font_size=32),
Label(text="OBD4", size_hint=(.5, .30),
pos_hint={'x': .5, 'y': .20}, font_size=32)
]
self.types = [Label(text="FILLER",
size_hint=(.5, .1),
pos_hint={'x': 0, 'y': .9},
font_size=32),
Label(text="FILLER",
size_hint=(.5, .1),
pos_hint={'x': .5, 'y': .9},
font_size=32),
Label(text="FILLER",
size_hint=(.5, .1),
pos_hint={'x': 0, 'y': .5},
font_size=32),
Label(text="FILLER",
size_hint=(.5, .1),
pos_hint={'x': .5, 'y': .5},
font_size=32)
]
self.change = Button(
text="Change OBD", size_hint=(.5, .20), pos_hint={'x': 0, 'y': 0}, font_size=32)
self.main = Button(
text="Return", size_hint=(.5, .20), pos_hint={'x': .5, 'y': 0}, font_size=32)
self.change.bind(on_press=self.switch_commands)
self.main.bind(on_release=self.go_to_parent)
for i in range(4):
self.layout.add_widget(self.values[i])
self.layout.add_widget(self.types[i])
self.layout.add_widget(self.change)
self.layout.add_widget(self.main)
self.add_widget(self.layout)
示例14: __init__
# 需要导入模块: from kivy.uix.screenmanager import Screen [as 别名]
# 或者: from kivy.uix.screenmanager.Screen import __init__ [as 别名]
def __init__(self, screen_accept, screen_cancel, name):
"""Pantalla para cambiar el password actual"""
self.scr_accept = screen_accept
self.scr_cancel = screen_cancel
self.data = {}
self.data['fondo'] = controlador.get_images('fondo')
self.data['aside'] = controlador.get_images('aside')
self.data['footer'] = controlador.get_images('footer')
self.cargar_datos()
self.name = name
Screen.__init__(self)
示例15: __init__
# 需要导入模块: from kivy.uix.screenmanager import Screen [as 别名]
# 或者: from kivy.uix.screenmanager.Screen import __init__ [as 别名]
def __init__(self, list_of_track_images, **kwargs):
Screen.__init__(self, **kwargs)
self._read_images(list_of_track_images)
self.looking_direction_x = 0
self.looking_direction_y = 0
self.eye_range_x = 120
self.eye_range_y = 85
self.eye_offset = 3
self._display_texture()