#!/usr/bin/env python
# -*- coding: utf-8 -*-
from libavg import avg
player = avg.Player.get()
# -*- coding: utf-8 -*-
from libavg import avg
player = avg.Player.get()
canvas = player.createMainCanvas(size=(640,480))
avg.WordsNode(pos=(10,10), font="arial", text="Hello World", parent=rootNode)
player.play()
前两行告诉系统,这是一个Python文件,它的使用UTF-8编码
canvas 表示创建窗口
然后创建一些文字
修改代码
node = avg.WordsNode(pos=(10,10), font="arial", text="hello World", parent=rootNode)
print node.x
node.x = 200
增加偏移量
newNode = avg.WordsNode(text="Hello libavg", pos=(10,30), parent=player.getRootNode())
增加一个新的文字