mouse-over.py 文件源码

python
阅读 36 收藏 0 点赞 0 评论 0

项目:wargame 作者: maximinus 项目源码 文件源码
def game():
    resources = os.path.join(os.getcwd(), '../')
    controller = wargame.engine.init(resources)

    # we need 2 images to display mouse over and mouse not over
    red = Resources.colour_surface(200, 200, (255, 0, 0))
    blue = Resources.colour_surface(200, 200, (0, 0, 255))

    # we need a node
    node = MouseOverNode(blue, red, pygame.Rect(220, 140, 200, 200))

    # I add the node to a SCENE
    scene = Scene([node])
    # I add the scene to the ENGINE
    controller.add_scene('start', scene)
    # I tell the engine what scene to start and run the controller
    controller.run('start')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号