Пример #1
0
    def __init__(self):
        super(TestLayer, self).__init__()

        x, y = director.get_window_size()

        self.sprite = Sprite('grossini.png', (x // 2, y // 2))
        self.add(self.sprite)

        self.sprite.do(Speed(Rotate(360, 10), 10))
Пример #2
0
    def __init__(self):
        super(TestLayer, self).__init__()

        x, y = director.get_window_size()

        self.sprite = Sprite('grossini.png', (x / 2, y / 2))
        self.add(self.sprite)

        self.sprite2 = Sprite('grossinis_sister1.png', (0, 101))
        self.sprite.add(self.sprite2)

        self.sprite3 = Sprite('grossinis_sister2.png', (0, 102))
        self.sprite2.add(self.sprite3)

        self.sprite.do(Rotate(360, 10))
        self.sprite2.do(ScaleBy(2, 5) + ScaleBy(0.5, 5))
        self.sprite2.do(Rotate(360, 10))
        self.sprite3.do(Rotate(360, 10))
        self.sprite3.do(ScaleBy(2, 5) + ScaleBy(0.5, 5))
Пример #3
0
    def __init__(self):
        super( TestLayer, self ).__init__()
        
        x,y = director.get_window_size()

        self.sprite = Sprite( 'grossini.png', (x/2, y/2) )
        self.add( self.sprite )
        move = MoveBy((100,0), 1)
        rot = Rotate(360, 1)
        seq = Place((x/4,y/2)) + rot+move+rot+move
        self.sprite.do( Repeat ( seq ) )
Пример #4
0
    def __init__(self):
        super(TestLayer, self).__init__()

        x, y = director.get_window_size()
        self.color = [127, 127, 127, 255]

        self.label = Label(time.ctime(), (x / 2, y / 2))
        self.label.do(Rotate(360, 10))
        self.add(self.label)

        self.schedule_interval(self.update_time, .1)
Пример #5
0
    def __init__(self):
        super( TestLayer, self ).__init__()

        x,y = director.get_window_size()

        self.sprite = Sprite( 'grossini.png', (x//2, y//2) )
        self.add( self.sprite )

        self.sprite2 = Sprite( 'grossini.png', (x//2, y//4) )
        self.add( self.sprite2 )

        seq = Rotate( 360, 10 ) | MoveBy((x//2,0))
        self.sprite.do( seq )
        self.sprite2.do( Reverse( seq ) )
    def __init__(self):
        super(TestLayer, self).__init__()

        x, y = director.get_window_size()
        self.color1 = [255, 0, 0, 255]
        self.color2 = [0, 0, 255, 255]

        self.label = Label('', (x // 2, y // 2))
        self.label.do(Rotate(360, 10))
        self.label.do(
            Repeat(
                Delay(1) + CallFunc(self.set_color, 0) + Delay(1) +
                CallFunc(self.set_color, 1) + Delay(1) +
                CallFunc(self.set_color, 2)))
        self.add(self.label)
        self.set_color(2)