本文整理汇总了Python中kivy.uix.relativelayout.RelativeLayout.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python RelativeLayout.__init__方法的具体用法?Python RelativeLayout.__init__怎么用?Python RelativeLayout.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kivy.uix.relativelayout.RelativeLayout
的用法示例。
在下文中一共展示了RelativeLayout.__init__方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from kivy.uix.relativelayout import RelativeLayout [as 别名]
# 或者: from kivy.uix.relativelayout.RelativeLayout import __init__ [as 别名]
def __init__(self, **args):
RelativeLayout.__init__(self, **args)
self.lastTouch = None
self.tiles = {}
self.viewPos = (50.7, -1.3)
self.viewZoom = 14
self.unscaledTileSize = 512
self.tileSize = metrics.dp(self.unscaledTileSize)
self.map = map.Map()
#source = osmfile.OsmFile("Simple.osm.gz")
source = osmfilecached.OsmFileCached("IsleOfWight-Fosm-Oct2013.osm.gz")
highways = maphighways.MapHighways()
highways.SetSource(source)
self.map.AddPlugin(highways)
water = mapwater.MapWater()
water.SetSource(source)
self.map.AddPlugin(water)
places = mapplaces.MapPlaces()
places.SetSource(source)
self.map.AddPlugin(places)
landscape = maplandscape.MapLandscape()
landscape.SetSource(source)
self.map.AddPlugin(landscape)
Clock.schedule_interval(self.LateRendering, 0.1)
self.bind(pos=self.update_graphics_pos,
size=self.update_graphics_size)
示例2: __init__
# 需要导入模块: from kivy.uix.relativelayout import RelativeLayout [as 别名]
# 或者: from kivy.uix.relativelayout.RelativeLayout import __init__ [as 别名]
def __init__(self, **kwargs):
self.ix = None
self.iy = None
RelativeLayout.__init__(self, **kwargs)
self.type = kwargs['type']
self.ix = kwargs['ix']
self.iy = kwargs['iy']
self.rectangle = None
self.bomb = None
self.effect = None
示例3: __init__
# 需要导入模块: from kivy.uix.relativelayout import RelativeLayout [as 别名]
# 或者: from kivy.uix.relativelayout.RelativeLayout import __init__ [as 别名]
def __init__(self, **kwargs):
self.image_size = kwargs['size']
RelativeLayout.__init__(self, size_hint=(None,None), **kwargs)
self.grid = kwargs['grid']
self.start_position = self.pos
self.frozen = False
self.alive = True
self.animation = None
self.safe_pos = self.pos
self.path = []
self.moving = False
self.last_to_tuple = None
self.move_duration = 0.25
self.setup()
self.init()
示例4: __init__
# 需要导入模块: from kivy.uix.relativelayout import RelativeLayout [as 别名]
# 或者: from kivy.uix.relativelayout.RelativeLayout import __init__ [as 别名]
def __init__(self, app, **kwargs):
RelativeLayout.__init__(self, **kwargs)
self.app = app
self.hidden = False
self.layout_color = BoxLayout(orientation='horizontal',
size_hint=(1, 1),
pos=(0, 0))
with self.layout_color.canvas:
Color(0.2, 0.2, 0.2, 1)
layout_rect = Rectangle(pos=self.pos, size=(Window.width * PALETTE_LAYOUT_SIZE_HINT[0],
Window.height * PALETTE_LAYOUT_SIZE_HINT[1]))
layout1 = BoxLayout(orientation='vertical', size_hint=PALETTE_LAYOUT_CLMN_SIZE_HINT, spacing=1,
padding=[1, 1, 0, 1])
self.butList1 = [x for x in xrange(0, PALETTE_BTN_COUNT)]
self.butList2 = [x for x in xrange(0, PALETTE_BTN_COUNT)]
self.colorpicker_dialog = dialog.ColorPickerDialog(self.app, (Window.width, Window.height))
for t in xrange(0, len(self.butList1)):
self.butList1[t] = PaletteToggleButton()
self.butList1[t].bind(on_press=partial(self.but_select, self.butList1[t]))
self.butList1[t].on_hold = partial(self.open_colorpicker, self.butList1[t])
self.butList1[t].background_normal = ""
layout1.add_widget(self.butList1[t])
self.butList1[t].background_color = (1, 0.05 * t, 0.05 * t, 1)
layout2 = BoxLayout(orientation='vertical', size_hint=PALETTE_LAYOUT_CLMN_SIZE_HINT, spacing=1,
padding=[1, 1, 0, 1])
for t in xrange(0, len(self.butList2)):
self.butList2[t] = PaletteToggleButton()
self.butList2[t].bind(on_press=partial(self.but_select, self.butList2[t]))
self.butList2[t].on_hold = partial(self.open_colorpicker, self.butList2[t])
self.butList2[t].background_normal = ""
layout2.add_widget(self.butList2[t])
self.butList2[t].background_color = (1, 0.05 * t, 0.05 * t, 1)
self.butList1[0].background_color = (1, 1, 1, 1)
self.butList1[1].background_color = (195 / 255., 195 / 255., 195 / 255., 1)
self.butList1[2].background_color = (185 / 255., 122 / 255., 87 / 255., 1)
self.butList1[3].background_color = (255 / 255., 174 / 255., 201 / 255., 1)
self.butList1[4].background_color = (255 / 255., 201 / 255., 14 / 255., 1)
self.butList1[5].background_color = (239 / 255., 228 / 255., 176 / 255., 1)
self.butList1[6].background_color = (181 / 255., 230 / 255., 29 / 255., 1)
self.butList1[7].background_color = (153 / 255., 217 / 255., 234 / 255., 1)
self.butList1[8].background_color = (112 / 255., 146 / 255., 190 / 255., 1)
self.butList1[9].background_color = (200 / 255., 191 / 255., 231 / 255., 1)
self.butList2[0].background_color = (0, 0, 0, 1)
self.butList2[1].background_color = (127 / 255., 127 / 255., 127 / 255., 1)
self.butList2[2].background_color = (136 / 255., 0 / 255., 21 / 255., 1)
self.butList2[3].background_color = (237 / 255., 28 / 255., 36 / 255., 1)
self.butList2[4].background_color = (255 / 255., 127 / 255., 39 / 255., 1)
self.butList2[5].background_color = (255 / 255., 242 / 255., 0 / 255., 1)
self.butList2[6].background_color = (34 / 255., 177 / 255., 76 / 255., 1)
self.butList2[7].background_color = (0 / 255., 162 / 255., 232 / 255., 1)
self.butList2[8].background_color = (63 / 255., 72 / 255., 204 / 255., 1)
self.butList2[9].background_color = (163 / 255., 73 / 255., 164 / 255., 1)
self.pos_in = (PALETTE_LAYOUT_POS_HINT[0] * Window.width, PALETTE_LAYOUT_POS_HINT[1] * Window.height)
self.pos_out = (Window.width + 1, PALETTE_LAYOUT_POS_HINT[1] * Window.height)
self.animation_show = Animation(pos=self.pos_in, transition='in_quad', duration=0.3)
self.animation_hide = Animation(pos=self.pos_out, transition='in_quad', duration=0.3)
self.size_hint = PALETTE_LAYOUT_SIZE_HINT
self.pos = self.pos_in
self.layout_color.add_widget(layout1)
self.layout_color.add_widget(layout2)
self.add_widget(self.layout_color)
self.btn_show_palette = ToggleButton(pos=(Window.width - PALETTE_BTN_SHOW_SIZE_HINT[0] * Window.width, 0),
background_normal=data_path('palette.png'),
background_down=data_path('palette_down.png'), border=[0, 0, 0, 0],
size_hint=PALETTE_BTN_SHOW_SIZE_HINT, on_press=self.animate_switch)
self.btn_show_palette.state = 'down'
示例5: __init__
# 需要导入模块: from kivy.uix.relativelayout import RelativeLayout [as 别名]
# 或者: from kivy.uix.relativelayout.RelativeLayout import __init__ [as 别名]
def __init__(self, **kwargs):
RelativeLayout.__init__(self, **kwargs)
self.item = SPACE
self.category = 'map'