Пример #1
0
 def f(args):
     a = Entity(pos=[args[0], args[1], args[2]])
     a.addComponent(
         ShapeGfxColor(shape=sh.Rect(256, 256),
                       fill=sh.SolidFill(r=props[1], g=props[2],
                                         b=props[3])))
     a.addComponent(
         Parallax(cam='maincam',
                  factor=[1, 1],
                  campos0=[128, 128],
                  pos0=[0, 0]))
     return a
Пример #2
0
def togglePause():
    if vars.paused:
        example.get('main').enableUpdate(True)
        example.removeByTag('shader')
    else:
        example.get('main').enableUpdate(False)
        a = Entity(pos=[0, 0, 1], tag='shader')
        a.addComponent(
            compo.ShapeGfxColor(shape=sh.Rect(256, 256),
                                fill=sh.SolidFill(r=0, g=0, b=0, a=64)))
        example.get('diag').add(a)
    vars.paused = not vars.paused
Пример #3
0
def togglePause():
    if vars.paused:
        example.get('main').enableUpdate(True)
        example.removeByTag('shader')
        #msg : example.Wrap1 = example.get('msg')
        #if msg.valid:
        #    example.killScript('msgscript')
        #    example.removeByTag('msg')
        #    example.removeByTag('msgbox')
        #    example.get('player').setState('walk', {})    
    else:
        example.get('main').enableUpdate(False)
        a = Entity(pos=[0,0,1], tag='shader')
        a.addComponent (compo.ShapeGfxColor(shape = sh.Rect(256, 256), fill = sh.SolidFill(r=0, g=0, b=0, a=64)))
        example.get('diag').add(a)
    vars.paused = not vars.paused