|

楼主 |
发表于 2024-12-11 08:02:15
|
显示全部楼层
- # coding: utf-8
- import cocos
- from cocos.actions import *
- import random
- class HelloWorld(cocos.layer.ColorLayer):
- def __init__(self):
- super(HelloWorld, self).__init__(0, 128, 255, 128)
- label = cocos.text.Label(
- '电脑思考中...',
- font_name='kaiti',
- font_size=70,
- color=(255, 128, 0, 255),
- anchor_x='center', anchor_y='center')
- label.position = 320, 240
- self.add(label)
- label.do(Rotate(360,1) + Delay(random.randint(1,4)) + Hide())
- def main():
- cocos.director.director.init()
- hello_layer = HelloWorld()
- main_scene = cocos.scene.Scene (hello_layer)
- cocos.director.director.run(main_scene)
- if __name__ == '__main__':
- main()
复制代码 |
|