带有adobe flash类api的多媒体库
Flapp的Python项目详细描述
flappy是一个跨平台的多媒体库,其api与actionscript 3 flash api非常相似。flappy是在sdl2库和openfl-lime项目中稍加修改的c/c++代码子集之上构建的。_ SDL2:http://libsdl.org
。_ openfl-lime:https://github.com/openfl/lime
图形支持
当前状态
----
*alpha版本
*没有python 3.x支持
*没有声音播放
在Mac或Linux中安装二进制包
-
,请尝试:
:::
在Windows中安装flappy
,在此处下载安装程序(flappy-xxx.win32.exe文件之一)。_这里:http://pypi.python.org/pypi/flappy下载
…_ cython:http://cython.org/下载
还需要以下库:
*sdl2
*freetype 2
*libpng 1.6
*libjpeg 6b
生成并安装flappy如下:
:
python setup.py install
或者您可以将此存储库克隆到与flappy的源目录相同的目录,并使用此命令生成和安装:
:
_存储库:https://github.com/pyronimous/flappy_pre-build_dependencies
quick example
----
此代码在大小为400x400像素的窗口中绘制一个黑色的橙色边框。每次你点击那个圆圈你就会看到字符串“耶!”在控制台输出中:
:
import flappy
from flappy.display import sprite
from flappy.events import mouseevent
class example(sprite):
def\uu init(self):
super(示例,self).\uu init_uuu()
circle=sprite()
circle.graphics.linestyle(4)
circle.graphics.beginfl(0xff8000)
circle.graphics.drawcircle(200,200,100)
circle.graphics.endfill()
self.addchild(circle)
circle.addEventListener(mouseevent.click,self.on庘circle庘click)
def on庘circle庘click(self,event):
打印“是!”
图片::http://i.imgur.com/wqtfqz2.png
为了进行比较,下面是actionscript 3中的代码,它也会这样做。
…_代码:https://gist.github.com/pyronimous/9588523
---
目前,文档是存根。但是你可以看看Flash的ActionScript3API参考资料。flappy.display、flappy.events、flappy.geom、flappy.text包中的类和方法与flash相应包中的类和方法非常相似。_参考:http://help.adobe.com/en-us/flashplatform/reference/actionscript/3/
图片:http://i.imgur.com/vvufh8f.png
。_ openfl-lime:https://github.com/openfl/lime
图形支持
当前状态
----
*alpha版本
*没有python 3.x支持
*没有声音播放
在Mac或Linux中安装二进制包
-
,请尝试:
:::
在Windows中安装flappy
,在此处下载安装程序(flappy-xxx.win32.exe文件之一)。_这里:http://pypi.python.org/pypi/flappy下载
…_ cython:http://cython.org/下载
还需要以下库:
*sdl2
*freetype 2
*libpng 1.6
*libjpeg 6b
生成并安装flappy如下:
:
python setup.py install
或者您可以将此存储库克隆到与flappy的源目录相同的目录,并使用此命令生成和安装:
:
_存储库:https://github.com/pyronimous/flappy_pre-build_dependencies
quick example
----
此代码在大小为400x400像素的窗口中绘制一个黑色的橙色边框。每次你点击那个圆圈你就会看到字符串“耶!”在控制台输出中:
:
import flappy
from flappy.display import sprite
from flappy.events import mouseevent
class example(sprite):
def\uu init(self):
super(示例,self).\uu init_uuu()
circle=sprite()
circle.graphics.linestyle(4)
circle.graphics.beginfl(0xff8000)
circle.graphics.drawcircle(200,200,100)
circle.graphics.endfill()
self.addchild(circle)
circle.addEventListener(mouseevent.click,self.on庘circle庘click)
def on庘circle庘click(self,event):
打印“是!”
图片::http://i.imgur.com/wqtfqz2.png
为了进行比较,下面是actionscript 3中的代码,它也会这样做。
…_代码:https://gist.github.com/pyronimous/9588523
目前,文档是存根。但是你可以看看Flash的ActionScript3API参考资料。flappy.display、flappy.events、flappy.geom、flappy.text包中的类和方法与flash相应包中的类和方法非常相似。_参考:http://help.adobe.com/en-us/flashplatform/reference/actionscript/3/
图片:http://i.imgur.com/vvufh8f.png