kivy studies

14
KIVY STUDIES #3.5 DAISUKE SAITO

Upload: daisuke-saito

Post on 17-Feb-2017

333 views

Category:

Education


0 download

TRANSCRIPT

Page 1: Kivy studies

KIVY STUDIES #3.5DAISUKE SAITO

Page 2: Kivy studies

2

OUTLINE

• About Kivy

• Installation

• Let’s try Kivy

• Build to Android APP

Page 3: Kivy studies

3

ABOUT KIVY

• ナチュナルユーザーインターフェースの環境• Windows, Mac, Linux, Android, iOS, RaspberryPi で動作するアプリケーションを開発できる

Page 4: Kivy studies

4

INSTALLATION FOR WINDOWS1. python -m pip install --upgrade pip wheel setuptools

2. python -m pip install docutils pygments pypiwin32 kivy.deps.sdl2 kivy.deps.glew kivy.deps.gstreamer --extra-index-url https://kivy.org/downloads/packages/simple/

3. python –m pip install kivy

• OpenCV 2.0 – Camera input.

• Pillow – Image and text display.

• PyEnchant – Spelling correction.

Other OS

http://qiita.com/Ds110/items/2988646cb6622648b463

http://qiita.com/dodo5522/items/46058b6cb3e7c94dd984

Page 5: Kivy studies

LET’S TRY KIVYSIMPLE APP

引用 t: http://qiita.com/Ds110/items/2988646cb6622648b463

Page 6: Kivy studies

THE USING KV LANGUAGE

Referencet: http://qiita.com/Ds110/items/2988646cb6622648b463

Page 7: Kivy studies

7

BUILD TO ANDROID APP

Page 8: Kivy studies

8

BUILDZER.SPEC

Page 9: Kivy studies

9

BUILD TO ANDROID APP

Page 10: Kivy studies

10

LT

Page 11: Kivy studies

11

日本語を扱う

• 基本は対応していない• フォントを追加することにより表示可能

Page 12: Kivy studies

12

このように書く# -*- coding: utf-8 -*-import kivy

from kivy.core.text import LabelBase, DEFAULT_FONT

from kivy.app import Appfrom kivy.uix.button import Button

Page 13: Kivy studies

13

このように書くLabelBase.register(DEFAULT_FONT, 'VL-Gothic-Regular.ttf')

class MyApp(App):

def build(self):

return Button(text='こんにちは ', font_size=“50pt")

if __name__ == '__main__':

MyApp().run()

参考 : http://blog.livedoor.jp/katsuooo_l/archives/42346599.html

Page 14: Kivy studies

14

表示できました