Kivy Advent Calendar 3日目 KivyでHello Worldを書く
簡単なHello Worldプログラムを書きます。
main.py
from kivy.app import App
from kivy.uix.button import Button
class HelloApp(App):
def build(self):
return Button(text = 'Hello World')
HelloApp().run()
main.pyをKivy.appにドラッグすると下記のようになります。
Kivy Advent Calendar 2日目 Mac OS XでKivyを動かす
下記のURLからdmgファイルをダウンロードします。
Kivy.appをApplicationsにドラッグします。
Kivyのソースコードをダウンロードします。
$ git clone http://github.com/kivy/kivy
kivy/examples 以下にあるフォルダーの中からソースコードをKivyのアイコンのドラッグします。
例えば、kivy/examples/demo/pictures/main.pyをドラッグすると下記のようなアプリケーションが起動されます。
Kivy Advent Calendar 1日目 Kivyはじめました
Hatena Blogに移行後は英語でブログを書こうとしたのですが、既に挫折しました。
日本語で(も)書きます。
Kivyはじめました。
iOS実機でtutorialのpongが動くところまで行きました。
次はHTML5の縦シューティングゲームをKivyに移植します。
<a href="https://px.a8.net/svt/ejp?a8mat=35O261+8LLG4A+4BRI+639IP" rel="nofollow">
<img border="0" width="300" height="250" alt="" src="https://www23.a8.net/svt/bgt?aid=190919161520&wid=002&eno=01&mid=s00000020187001023000&mc=1"></a>
<img border="0" width="1" height="1" src="https://www14.a8.net/0.gif?a8mat=35O261+8LLG4A+4BRI+639IP" alt="">
How to build kivy-ios with MacPorts
http://kivy.org/docs/guide/packaging-ios.html
A kivy-ios building process uses Homebrew.
I could not build with MacPorts.
Building process with MacPorts is as follows,
$ git clone git://github.com/kivy/kivy-ios $ cd kivy-ios
Apply this patch...
--- a/tools/build-sdlmixer.sh
+++ b/tools/build-sdlmixer.sh
@@ -47,7 +47,7 @@ if [ ! -f libtremor/tremor/.libs/libvorbisidec.a ]; then
OGG_CFLAGS="-I../../libogg/include" \
OGG_LDFLAGS="-L../../libogg/src/.libs" \
PKG_CONFIG_LIBDIR="../../libogg" \
- ACLOCAL_FLAGS="-I $DESTROOT/share/aclocal -I /usr/local/share/aclocal" .
+ ACLOCAL_FLAGS="-I $DESTROOT/share/aclocal -I /opt/local/share/aclocal" .
--prefix=$DESTROOT \
--disable-shared \
$ tools/build-all.sh
ref.
#26 Enable building on MacPorts based installation