• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python scene.run函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中scene.run函数的典型用法代码示例。如果您正苦于以下问题:Python run函数的具体用法?Python run怎么用?Python run使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了run函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: __init__

 def __init__(self):
     self.scenes = [scn for scn in find_scenes()]
     assert self.scenes, "No Scene files found!"
     print("{} scenes imported: {}".format(len(self.scenes), self.scenes))
     self.scene_index = -1
     self.switch_scenes()
     scene.run(self, orientation=scene.LANDSCAPE)
开发者ID:Mr-Coxall,项目名称:MultisceneTest,代码行数:7,代码来源:SceneSwitcher.py


示例2: __init__

 def __init__(self):
     self.img2 = photos.pick_image()
     self.img = self.img2.convert('RGBA') #fix for current scene.load_pil_image()
     if self.img:
         self.picsize = scene.Size(*self.img.size)
         scene.run(self)
     else:
         print('Good bye!')
开发者ID:buschfsu,项目名称:scene-tutorial,代码行数:8,代码来源:intermediate001-1.py


示例3: __init__

 def __init__(self):
     self.text = raw_input('Text to insert in the picture [Hello]: ') or 'Hello'
     self.position = None
     self.fontnr = 0       # Helvetica
     self.colornr = 3      # red
     self.fontsize = 48.0  # 48 point
     self.img2 = photos.pick_image()
     self.img = self.img2.convert('RGBA') #fix for current scene.load_pil_image()
     self.picsize = scene.Size(*self.img.size)
     self.btn_height = 0
     if self.img:
         scene.run(self, frame_interval=3)   # save battery with less frame rates -> 3 = 20fps
     else:
         print('Good bye!')
开发者ID:c0ns0le,项目名称:Pythonista,代码行数:14,代码来源:photo_text.py


示例4: __init__

 def __init__(self):
     self.distance_old = 0.0
     self.distance_new = 0.0
     self.distance_abs = 0.0
     self.reset = True
     self.zoom = 1.0        #no zoom
     self.zoom_min = 0.5
     self.zoom_max = 5
     self.zoom_speed = 3
     self.img2 = photos.pick_image()
     self.img = self.img2.convert('RGBA') #fix for current scene.load_pil_image()
     if self.img:
         self.picsize = scene.Size(*self.img.size)
         scene.run(self)
     else:
         print('Good bye!')
开发者ID:buschfsu,项目名称:scene-tutorial,代码行数:16,代码来源:intermediate001-solution.py


示例5: __init__

 def __init__(self):
     self.text = raw_input('Text to insert in the picture [Hello]: ') or 'Hello'
     self.position = None
     self.fontnr = 0       # Helvetica
     self.colornr = 3      # red
     self.fontsize = 48.0  # 48 point
     self.img = photos.pick_image()
     self.picsize = scene.Size(*self.img.size)
     if self.picsize.h > self.picsize.w:
         print('Sorry at the moment only landscape or square pictures are supported!')
         self.img = None
     self.picborder = None
     self.btn_height = 0
     if self.img:
         scene.run(self)
     else:
         print('Good bye!')
开发者ID:cclauss,项目名称:photo_text,代码行数:17,代码来源:photo_text.py


示例6: run

def run(game, frame_delay=1):
    game.conf()
    if not gamepie.isPieSupported(game.gamepie):
        game = gamepie.ErrorPie(
            "Target GamePie version is not supported: %s" % game.gamepie)

    for module in __required__:
        setattr(gamepie, module,
            importlib.import_module("gamepie." + module))

    if not "graphics" in __required__:
        # We need this module any way
        setattr(gamepie, "graphics",
            importlib.import_module("gamepie.graphics"))

    gamepie.graphics.setSetting("width", game.size[0])
    gamepie.graphics.setSetting("height", game.size[1])

    scene.run(PieScene(game), frame_interval=frame_delay)
开发者ID:Vik2015,项目名称:gamepie,代码行数:19,代码来源:gamepie.py


示例7: gui

 def gui(self):
     """Spawn a GUI for the game.  **Only works in Pythonista, on other platforms does nothing."""
     from Phantom.constants import in_pythonista
     if in_pythonista:
         from Phantom.gui_pythonista.main_scene import MultiScene
         from Phantom.gui_pythonista.screen_main import ChessMainScreen
         from Phantom.gui_pythonista.screen_loading import ChessLoadingScreen
         from Phantom.gui_pythonista.screen_options import ChessOptionsScreen
         from Phantom.gui_pythonista.screen_promote import ChessPromoteScreen
         self.data['screen_main'] = ChessMainScreen(self)
         self.data['screen_load'] = ChessLoadingScreen()
         self.data['screen_options'] = ChessOptionsScreen(self)
         self.data['screen_promote'] = ChessPromoteScreen(self)
         self.data['main_scene'] = MultiScene(self.data['screen_load'])
         self.data['screen_main'].set_parent(self.data['main_scene'])
         self.data['screen_load'].set_parent(self.data['main_scene'])
         self.data['screen_options'].set_parent(self.data['main_scene'])
         self.data['screen_promote'].set_parent(self.data['main_scene'])
         self.data['main_scene'].switch_scene(self.data['screen_load'])
         import scene
         scene.run(self.data['main_scene'])
开发者ID:c0ns0le,项目名称:Pythonista,代码行数:21,代码来源:game_class.py


示例8: main

def main():
    scene = Scene()
    ui.run(scene)
开发者ID:cclauss,项目名称:snake-ios,代码行数:3,代码来源:snake.py


示例9: Coord

            pos = Coord(896, turn_y)
            size = Coord(scale_factor / 2, scale_factor / 2)
            scene.tint(1, 1, 1, 1)
            scene.image(self.turn_indicator_img, pos.x, pos.y, size.x, size.y)
            scene.tint(1, 1, 1, 1)
        if self.won:
            pos = Coord(self.size.w/2, self.size.h/2)
            scene.tint(0.32645,0.28306,0.93492)
            # commented out until the bug in ChessGame.is_won() is fixed to be 
            # less annoying
            scene.text('{} wins'.format(self.won), x=pos.x, y=pos.y, font_size=40.0)
            scene.tint(1, 1, 1, 1)
        
        # Buttons
        scene.text('AI Easy', x=scale_factor/2, y=scale_factor*6 - scale_factor/2)
        scene.text('AI Hard', x=scale_factor/2, y=scale_factor*5 - scale_factor/2)
        scene.text('Get score', x=scale_factor/2, y=scale_factor*4 - scale_factor/2)
        if self.disp_score:
            scene.text(str(self.pos_score), x=scale_factor/2, y=scale_factor*4 - scale_factor/1.5)
        scene.text('Undo', x=scale_factor/2, y=scale_factor*3 - scale_factor/2)
        scene.text('Deselect', x=scale_factor/2, y=scale_factor*2 - scale_factor/2)
        scene.text('Options', x=scale_factor/2, y=scale_factor*7 - scale_factor/2)

if __name__ == '__main__':
    from Phantom.core.game_class import ChessGame, loadgame
    game = ChessGame() #loadgame('Long Endgame 1')
    game.board.cfg.disp_sqrs = True
    s = ChessMainScreen(game)
    scene.run(s)

开发者ID:c0ns0le,项目名称:Pythonista,代码行数:29,代码来源:screen_main.py


示例10: animate

def animate(wall, *args, **kwargs):
    anim = Scene()
    anim.do_setup(wall)
    scene.run(anim, *args, **kwargs)
开发者ID:Vik2015,项目名称:colorwall,代码行数:4,代码来源:colorwall.py


示例11: key_down

        im = scene.load_image_file('white_rectangle_512_512.png')
        self.sprite_node = scene.SpriteNode(im, position=(400,400),
            size=(96, 64),
            parent=self)
        self.sprite_node.shader = scene.Shader(fragment_shader_text)


    def key_down(self, key):
        if key.key_val == pyglet.window.key.RIGHT:
            self.sprite_node.position = ((self.sprite_node.position[0]+10)%self.size[0],
                                    self.sprite_node.position[1])
        elif key.key_val == pyglet.window.key.LEFT:
            self.sprite_node.position = ((self.size[0]+self.sprite_node.position[0]-10)%self.size[0],
                                    self.sprite_node.position[1])
        elif key.key_val == pyglet.window.key.UP:
            self.sprite_node.position = (self.sprite_node.position[0],
                                    (self.sprite_node.position[1]+10)%self.size[1])
        elif key.key_val == pyglet.window.key.DOWN:
            self.sprite_node.position = (self.sprite_node.position[0],
                                    (self.size[0]+self.sprite_node.position[1]-10)%self.size[1])
        #else:
        #    self.label.text = "Key pressed %s" % chr(key.key_val)

    def touch_began(self, touch):
        self.sprite_node.position = touch.location

    def touch_moved(self, touch):
        self.sprite_node.position = touch.location

scene.run(MyScene(screen_width=800, screen_height=800))
开发者ID:balachandrana,项目名称:pythonista_pyglet_simulation,代码行数:30,代码来源:test_shape2.py


示例12: len

         else :
            y=r[self.idx%Nr].data()
         # start idx, stop idx+1
         r[self.idx%Nr].record()
         #stop recorder a few samples before im ready to read it
         lookaheadidx=self.idx+1+int(0.25//(T/(Nr-1)))
         r[lookaheadidx%Nr].stop()
         self.idx+=1

         if len(y)==0:
            return

         for i,n in enumerate(self.v):
            iy=int(i/Np*len(y))
            n.position=(i/Np*W,y[iy]*H+H/2)
      def did_stop(self):
         print 'stopping'
         #raise Error()
         self['n'][0].remove_all_actions()
         [rec.stop() for rec in r]
         ui.delay(cleanup,0.25)
         # the scene seems to crash when restarting, unless we raise an error here
         raise KeyboardInterrupt

   
   #sc=Vis(dofft=True)
   sc=Vis(dofft=False)
   sc.shows_fps=True
   sc.shows_node_count=True
   scene.run(sc)
开发者ID:jsbain,项目名称:audiovis,代码行数:30,代码来源:audiovis.py


示例13: __init__

 def __init__(self):
     scene.run(self)
开发者ID:c0ns0le,项目名称:Pythonista,代码行数:2,代码来源:SceneTransition.py


示例14: range

		except:
			wx=wy=wz=sx=sy=sz=.5
		ue=(-wx,-wy,-wz)
		un=(sx,sy,sz)
		uu=(-gx,-gy,-gz)
		physvert=[None for i in range(8)]
		for j in range(8):
			i=cvert[j]
			cx=i[0]*ue[0]+i[1]*un[0]+i[2]*uu[0]
			cy=i[0]*ue[1]+i[1]*un[1]+i[2]*uu[1]
			cz=i[0]*ue[2]+i[1]*un[2]+i[2]*uu[2]
			physvert[j]=[cx,cy,cz]
		faces=((2,3,6,7,'#ff6060'),(0,1,4,5,'#a00000'),(0,3,4,7,'#60ff60'),(1,2,5,6,'#00a000'),(0,1,3,2,'#6060ff'),(4,5,7,6,'#0000a0'))
		faceord=sorted([0,1,2,3,4,5],key=lambda t: sum([physvert[n][2] for n in faces[t][:4]]))
		visvert=[]
		D=4*self.size.width*.5/(.61*19.8)
		centx,centy=self.size/2
		for i in physvert:
			x,y,z=i
			rad=D*20/(65-z)
			visvert.append((rad*x+centx,rad*y+centy))
		for i in faceord:
			scene_drawing.fill(faces[i][4])
			scene_drawing.triangle_strip([visvert[j] for j in faces[i][:4]])

	def stop(self):
		stop_updates()

if __name__=='__main__':
	scene.run(quubcam(),scene.PORTRAIT,show_fps=True)
开发者ID:quadrohedron,项目名称:qdh_pythonista,代码行数:30,代码来源:quub_beta.py


示例15: MyClass

import scene

class MyClass(scene.Scene): 
    def draw(self):
        # this method draws 60 times per second the blue background, if you don't change it
        scene.background(0,0,1) # 0,0,1 = blue

scene.run(MyClass())
开发者ID:buschfsu,项目名称:scene-tutorial,代码行数:8,代码来源:beginner001.py


示例16: Scene1

# Scene1

import scene, sound

class Scene1(scene.Scene):
    def __init__(self, main_scene=None):
        self.main_scene = main_scene

    def draw(self):
        scene.background(0, 1, 0)

    def touch_began(self, touch):
        sound.play_effect('Beep')
        if self.main_scene:
            self.main_scene.switch_scenes()

if __name__ == '__main__':
    scene.run(Scene1())
开发者ID:Mr-Coxall,项目名称:MultisceneTest,代码行数:18,代码来源:Scene1.py


示例17: Scene0

# Scene0

import scene, sound

class Scene0(scene.Scene):
    def __init__(self, main_scene=None):
        self.main_scene = main_scene

    def draw(self):
        scene.background(1, 0, 0)

    def touch_began(self, touch):
        sound.play_effect('Coin_1')
        self.main_scene.switch_scenes()

if __name__ == '__main__':
    scene.run(Scene0())
开发者ID:Mr-Coxall,项目名称:MultisceneTest,代码行数:17,代码来源:Scene0.py


示例18: __init__

 def __init__(self):
     self.save_velocity_x = g_speed
     self.enemies = [random_particle() for i in xrange(g_number_of_enemies)]
     scene.run(self, scene.LANDSCAPE)
开发者ID:azadel,项目名称:Pythonista_scene,代码行数:4,代码来源:stop_and_go.py


示例19: __init__

 def __init__(self, start_scene):
     self.active_scene = start_scene()
     scene.run(self)
开发者ID:SebastianJarsve,项目名称:Cloud-Jump-2,代码行数:3,代码来源:menu_test.py


示例20: rc_filter

       p.line_to(0.08*6000,20)
       self.chart_clk.path=p
       p=scene.ui.Path()
       p.move_to(0,20)
       for a in [(t*6000,(1-y)*20) for t,y in rc_filter(gen_pwl(generate_pw((list(d3.items())[j*3+i][1]))))]:
         p.line_to(*a)
       p.line_to(0.08*6000,20)
       self.chart_dat.path=p
       for x in generate_signal((list(d3.items())[j*3+i][1])):
#         print(x)
         for IR,led in self.IR_Receivers:
           IR.clk,IR.rx=(x[0]^1,x[1]^1)
       for IR,led in self.IR_Receivers:
         led.fill_color=('darkgreen','lightgreen')[IR.D7]
       
IR1=IrRemote()
scene.run(IR1,scene.LANDSCAPE,show_fps=True)
#runTests()
#testStateMachine(codes= ( d2['KEY_NEXT'],d2['KEY_PLAYPAUSE'],d2['KEY_NEXT'],d2['KEY_PLAYPAUSE']) )
#testStateMachine(fbp=10,ba=0b100001<<7)#+
#testStateMachine(fbp=10,ba=0b010001<<7)#+
#testStateMachine(fbp=10,ba=0b000000<<7)#+
#testStateMachine(fbp= 7,ba=0b101000<<7)#+
#testStateMachine(fbp= 7,ba=0b011000<<7)#+
#testStateMachine(fbp= 7,ba=0b000000<<7)#+
#testStateMachine(fbp=11,ba=0b001001<<7)#+
#testStateMachine(fbp=11,ba=0b000000<<7)#+
#with open('IR_Remote_a.bin','wb') as f: f.write(bytes(g));f.close()

  
开发者ID:RichardPotthoff,项目名称:myrepo,代码行数:28,代码来源:Ir.py



注:本文中的scene.run函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python scene.GraphScene类代码示例发布时间:2022-05-27
下一篇:
Python scene.background函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap