Skip to content

Commit

Permalink
First commit for Kivy Contest 2014
Browse files Browse the repository at this point in the history
  • Loading branch information
suriyan committed May 14, 2014
1 parent 7753ee5 commit a9933b0
Show file tree
Hide file tree
Showing 16 changed files with 749 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,4 @@ coverage.xml
# Sphinx documentation
docs/_build/

*.ini
3 changes: 3 additions & 0 deletions android.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
title=iWriteIt
author=Suriyan Laohaprapanon
orientation=landscape
Binary file added fonts/RaiNgan.ttf
Binary file not shown.
1 change: 1 addition & 0 deletions gestures/raingan.kg

Large diffs are not rendered by default.

Binary file added graphics/background.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added graphics/icon-128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added graphics/icon-256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added graphics/icon-32.ico
Binary file not shown.
Binary file added graphics/icon-32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added graphics/icon-512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added graphics/icon-64.ico
Binary file not shown.
Binary file added graphics/icon-64.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
48 changes: 48 additions & 0 deletions helpers.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
"""
iWriteIt - You Like?
Copyright (C) 2014 Suriyan Laohaprapanon
For comments, suggestions or other messages, contact me at:
<[email protected]>
This file is part of iWriteIt.
iWriteIt is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
iWriteIt is distributed in the hope that it will be fun,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with iWriteIt. If not, see <http://www.gnu.org/licenses/>.
"""

from kivy.uix.popup import Popup
from kivy.properties import StringProperty
from kivy.lang import Builder
from kivy.clock import Clock

Builder.load_string('''
<InfoPopup>:
auto_dismiss: True
size_hint: None, None
size: 400, 200
on_open: root.dismiss_trigger()
title: root.title
Label:
text: root.text
''')


class InfoPopup(Popup):
title = StringProperty('Information')
text = StringProperty('')

def __init__(self, time=2, **kwargs):
super(InfoPopup, self).__init__(**kwargs)
self.dismiss_trigger = Clock.create_trigger(self.dismiss, time)
307 changes: 307 additions & 0 deletions iwriteit.kv
Original file line number Diff line number Diff line change
@@ -0,0 +1,307 @@
#
# iWriteIt - You Like?
#
# Copyright (C) 2014 Suriyan Laohaprapanon
#
# For comments, suggestions or other messages, contact me at:
# <[email protected]>
#
# This file is part of iWriteIt.
#
# iWriteIt is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# iWriteIt is distributed in the hope that it will be fun,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with iWriteIt. If not, see <http://www.gnu.org/licenses/>.
#

#:kivy 1.4

<DigitBox>:
size_hint: 0.5, 0.8
text: ""
canvas.before:
Color:
rgba: (1, 1, 1, 0.1)
Rectangle:
pos: self.pos
size: self.size
Label:
text: root.text
font_name: "fonts/RaiNgan.ttf"
font_size: 180
size: root.size
pos: root.pos

<AppSettings>:
orientation: 'vertical'
padding: 10
app: app
GridLayout:
cols: 2
Label:
text: 'Music'
font_name: "fonts/RaiNgan.ttf"
font_size: 32
Switch:
id: _music
active: True
Label:
text: "Voice"
font_name: "fonts/RaiNgan.ttf"
font_size: 32
Switch:
id: _voice
active: True
Label:
text: "Max digits"
font_name: "fonts/RaiNgan.ttf"
font_size: 32
Spinner:
id: _maxdigits
text: "2"
values: "2", "3"
font_name: "fonts/RaiNgan.ttf"
font_size: 32
opacity: 1.0
Label:
text: "Operation"
font_name: "fonts/RaiNgan.ttf"
font_size: 32
Spinner:
id: _operation
text: "Plus"
values: "Plus", "Minus", "Mix"
font_name: "fonts/RaiNgan.ttf"
font_size: 32
opacity: 1.0
Widget:
height: 10
Button:
font_name: "fonts/RaiNgan.ttf"
font_size: 40
size_hint: 1, 0.1
pos_hint: {'bottom': 0.9}
text: "Apply"
opacity: 1.0
on_release: root.write_settings()

<WriteBoard>:
digit1: _digit1
digit2: _digit2
digit3: _digit3
digit4: _digit4
result_area: _result_area
surface: _gesture
menu: _menu
FloatLayout:
GridLayout:
id: _menu
cols: 1
size_hint: 0.2, None
pos: 40, root.height - self.height - 40
Button:
text: "Back"
on_release: app.root.manager.current = 'start'
font_name: "fonts/RaiNgan.ttf"
font_size: 32
Button:
text: "Clear"
font_name: "fonts/RaiNgan.ttf"
font_size: 32
on_release: app.root.board.clear(True)
Button:
text: "?"
font_name: "fonts/RaiNgan.ttf"
font_size: 32
on_release: app.root.manager.current = 'help'

GestureSurface:
id: _gesture
draw_timeout: 3
temporal_window: 1
bbox_margin: 10
line_width: 3
draw_bbox: True
use_random_color: True
BoxLayout:
cols: 1
orientation: 'vertical'
padding: 40
spacing: 10
GridLayout:
cols: 4
Label:
id: a4
text: "1"
bold: True
font_name: "fonts/RaiNgan.ttf"
font_size: 180
Label:
id: a3
text: "2"
bold: True
font_name: "fonts/RaiNgan.ttf"
font_size: 180
Label:
id: a2
text: "3"
bold: True
font_name: "fonts/RaiNgan.ttf"
font_size: 180
Label:
id: a1
text: "4"
bold: True
font_name: "fonts/RaiNgan.ttf"
font_size: 180
Label:
id: _operator
text: "+"
size_hint: 0.1, 0.1
font_name: "fonts/RaiNgan.ttf"
font_size: 120
pos_hint: {'right': 0.90}
GridLayout:
cols: 4
Label:
id: b4
text: "5"
bold: True
font_name: "fonts/RaiNgan.ttf"
font_size: 180
Label:
id: b3
text: "6"
bold: True
font_name: "fonts/RaiNgan.ttf"
font_size: 180
Label:
id: b2
text: "7"
bold: True
underline: True
font_name: "fonts/RaiNgan.ttf"
font_size: 180
Label:
id: b1
text: "8"
bold: True
underline: True
font_name: "fonts/RaiNgan.ttf"
font_size: 180
GridLayout:
id: _result_area
cols: 4
DigitBox:
id: _digit4
DigitBox:
id: _digit3
DigitBox:
id: _digit2
DigitBox:
id: _digit1
# Background description:
<Background>:
source: self.source
allow_stretch: True
keep_ratio: False
size: self.size

<RootWidget>:
#This is the root widget's kv definition
id: _root
manager: manager
board: _board
settings: _settings
ScreenManager:
id: manager
#size_hint: 1, 1
#pos_hint: {'top': 1}
Screen:
name: 'start'
Background:
id: background
source: 'graphics/background.jpg'
GridLayout:
cols: 1
padding: 50
Label:
text: "[b]==> iWriteIt <==[/b]\n\njust write your answer\n\nare you like it?"
font_name: "fonts/RaiNgan.ttf"
font_size: 60
halign: 'center'
markup: True
GridLayout:
rows: 1
size_hint: 0.8, 0.2
pos_hint: {'bottom': 0.8}
spacing: 50
Button:
text: "Start"
font_name: "fonts/RaiNgan.ttf"
font_size: 40
on_release: app.start()
Button:
text: "Settings"
on_release: app.settings()
font_name: "fonts/RaiNgan.ttf"
font_size: 40
Screen:
name: 'writing'
Background:
id: background
source: 'graphics/background.jpg'
WriteBoard:
id: _board
root: _root
Screen:
name: 'settings'
Background:
id: background
source: 'graphics/background.jpg'
GridLayout:
cols: 1
padding: 50
AppSettings:
id: _settings
Button:
font_name: "fonts/RaiNgan.ttf"
font_size: 40
size_hint: 0.5, 0.1
pos_hint: {'bottom': 0.9}
text: "Back"
on_release: app.root.manager.current = 'start'
Screen:
name: 'help'
Background:
id: background
source: 'graphics/background.jpg'
GridLayout:
cols: 1
padding: 50
GridLayout:
cols: 1
Label:
text: 'These are writing style support in this version\nWe will support your own writing style soon!'
font_name: "fonts/RaiNgan.ttf"
font_size: 32
halign: 'center'
Label:
text: "0 1 2 3 4\n\n5 6 7 8 9\n"
font_name: "fonts/RaiNgan.ttf"
font_size: 80
Button:
font_name: "fonts/RaiNgan.ttf"
font_size: 40
size_hint: 0.5, 0.1
pos_hint: {'bottom': 0.9}
text: "Back"
on_release: app.root.manager.current = 'writing'
Loading

0 comments on commit a9933b0

Please sign in to comment.