mirror of https://github.com/kivy/kivy.git
doc/gettingstarted: fix links on installation + add os icon
+ pushed tutorial section
This commit is contained in:
parent
aee9ce0ae9
commit
488c24965b
|
@ -55,7 +55,6 @@ a:hover {
|
|||
}
|
||||
|
||||
|
||||
|
||||
/** Header
|
||||
*/
|
||||
#topbar {
|
||||
|
@ -599,6 +598,11 @@ table.field-list th.field-name {
|
|||
|
||||
/** Image link
|
||||
*/
|
||||
div.body .align-left {
|
||||
float: left;
|
||||
margin: 0 20px 20px 20px;
|
||||
}
|
||||
|
||||
div.body .align-right {
|
||||
float: right;
|
||||
margin: 0 0 20px 20px;
|
||||
|
@ -648,3 +652,23 @@ dl.api-level dt {
|
|||
cursor: pointer;
|
||||
}
|
||||
|
||||
/* Getting started
|
||||
*/
|
||||
.gs-osimage {
|
||||
margin-top: 10px;
|
||||
width: 264px !important;
|
||||
height: 168px;
|
||||
float: left;
|
||||
}
|
||||
.gs-osimage canvas {
|
||||
width: 128px !important;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.gs-osimage img {
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.gs-osimage-last {
|
||||
clear: right;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,20 @@
|
|||
A first App
|
||||
===========
|
||||
|
||||
the simplest App possible, with a kv file using only basic widgets.
|
||||
Jump into the code
|
||||
------------------
|
||||
|
||||
Immerse yourself into the world of Kivy with your first App.
|
||||
|
||||
.. image:: ../images/gs-tutorial.png
|
||||
:align: center
|
||||
|
||||
The :doc:`/tutorials/pong` introduces the fundamental design patterns and
|
||||
application development process. As you follow the tutorial, you will create a simple app.
|
||||
You will also learn how to run your app in on your OS. The simple steps in the tutorial
|
||||
introduce elegant, useful concepts that you use over and over again in app development.
|
||||
|
||||
Your :doc:`/tutorials/pong` is the most important article in the road map. It
|
||||
lays the foundation for the concepts that you will learn more about later. Each
|
||||
of the other articles expands on one of those concepts.
|
||||
|
||||
|
|
|
@ -1,37 +1,36 @@
|
|||
Installation
|
||||
============
|
||||
|
||||
Installing Tools
|
||||
----------------
|
||||
Installing Kivy SDK
|
||||
-------------------
|
||||
|
||||
Using Kivy software development kit you can create using your choice of a favourite
|
||||
development enviornment to rapidly churn out a App.
|
||||
Using Kivy SDK, you can use your favorite development environment to start
|
||||
coding your App.
|
||||
|
||||
.. image: ../images/gs-installation.png
|
||||
To get started, you need to download the latest version of Kivy:
|
||||
|
||||
To get started, you need to:
|
||||
|
||||
Download the latest version of Kivy. at http://kivy.org/#download
|
||||
http://kivy.org/#download
|
||||
|
||||
Please refer to the installation instructions for your specific platform:
|
||||
|
||||
Installation on Windows
|
||||
Start a Kivy Application
|
||||
Start from Command-Line
|
||||
Package Contents
|
||||
Installation on MacOSX
|
||||
Start any Kivy Application
|
||||
Start from Command Line
|
||||
Installation on Linux
|
||||
Prerequisites
|
||||
Installation
|
||||
Start from Command Line
|
||||
Installation on Android
|
||||
Installation of Examples
|
||||
Packaging for IOS
|
||||
.. image:: ../images/windows.png
|
||||
:alt: Windows
|
||||
:target: ../installation/installation-windows.html
|
||||
:class: gs-osimage
|
||||
|
||||
If you want to use the devlopment version of Kivy, so you can use the last additions to the framework, you can get the source code from github.
|
||||
.. image:: ../images/macosx.png
|
||||
:alt: MacOSX
|
||||
:target: ../installation/installation-macosx.html
|
||||
:class: gs-osimage
|
||||
|
||||
.. image:: ../images/linux.png
|
||||
:alt: Linux
|
||||
:target: ../installation/installation-linux.html
|
||||
:class: gs-osimage gs-osimage-last
|
||||
|
||||
If you want to use the development version of Kivy, so you can use the last
|
||||
additions to the framework, you can get the source code from github::
|
||||
|
||||
git clone http://github.com/kivy/kivy
|
||||
|
||||
Take a look at our instructions on Installation of Development version.
|
||||
Take a look at our instructions on Installation of :ref:`installation_devel`
|
||||
|
|
|
@ -23,7 +23,7 @@ Follow this guide to get the tools you need, understand the major concepts and
|
|||
best practices, as this is an introduction, pointers will be provided at the
|
||||
end of each section to find more information.
|
||||
|
||||
As you proceed through the guide, you will, using kivy sdk:
|
||||
As you proceed through the guide, you will, using Kivy SDK:
|
||||
|
||||
- **Learn**: The basics of programming with the Kivy language.
|
||||
- **Explore**: The Kivy framework.
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 58 KiB |
Binary file not shown.
After Width: | Height: | Size: 15 KiB |
Binary file not shown.
After Width: | Height: | Size: 12 KiB |
Binary file not shown.
After Width: | Height: | Size: 17 KiB |
|
@ -1,3 +1,5 @@
|
|||
.. _installation_linux:
|
||||
|
||||
Installation on Linux
|
||||
=====================
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
.. _installation_macosx:
|
||||
|
||||
Installation on MacOSX
|
||||
======================
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
.. _installation_windows:
|
||||
|
||||
Installation on Windows
|
||||
=======================
|
||||
|
||||
|
|
|
@ -52,6 +52,8 @@ Please refer to the installation instructions for your specific platform:
|
|||
installation-android
|
||||
|
||||
|
||||
.. _installation_devel:
|
||||
|
||||
Development Version
|
||||
-------------------
|
||||
|
||||
|
|
|
@ -1,30 +1,31 @@
|
|||
import kivy
|
||||
kivy.require('1.1.1')
|
||||
|
||||
from kivy.app import App
|
||||
from kivy.uix.widget import Widget
|
||||
from kivy.properties import NumericProperty, ReferenceListProperty, ObjectProperty
|
||||
from kivy.vector import Vector
|
||||
from kivy.factory import Factory
|
||||
from kivy.clock import Clock
|
||||
from random import randint, random
|
||||
|
||||
|
||||
class PongPaddle(Widget):
|
||||
score = NumericProperty(0)
|
||||
|
||||
|
||||
def bounce_ball(self, ball):
|
||||
if self.collide_widget(ball):
|
||||
vx, vy = ball.velocity
|
||||
offset = (ball.center_y-self.center_y)/(self.height/2)
|
||||
bounced = Vector(-1*vx, vy)
|
||||
vel = bounced * 1.1
|
||||
ball.velocity = vel.x, vel.y + offset
|
||||
ball.velocity = vel.x, vel.y + offset
|
||||
|
||||
|
||||
class PongBall(Widget):
|
||||
velocity_x = NumericProperty(0)
|
||||
velocity_y = NumericProperty(0)
|
||||
velocity = ReferenceListProperty(velocity_x, velocity_y)
|
||||
|
||||
|
||||
def move(self):
|
||||
self.pos = Vector(*self.velocity) + self.pos
|
||||
|
||||
|
@ -37,14 +38,14 @@ class PongGame(Widget):
|
|||
def serve_ball(self, vel=(4,0)):
|
||||
self.ball.center = self.center
|
||||
self.ball.velocity = vel
|
||||
|
||||
|
||||
def update(self, *args):
|
||||
self.ball.move()
|
||||
|
||||
|
||||
#bounce of paddles
|
||||
self.player1.bounce_ball(self.ball)
|
||||
self.player2.bounce_ball(self.ball)
|
||||
|
||||
|
||||
#bounce ball off bottom or top
|
||||
if (self.ball.y < self.y) or (self.ball.top > self.top):
|
||||
self.ball.velocity_y *= -1
|
||||
|
@ -56,8 +57,8 @@ class PongGame(Widget):
|
|||
if self.ball.x > self.width:
|
||||
self.player1.score += 1
|
||||
self.serve_ball(vel=(-4,0))
|
||||
|
||||
|
||||
|
||||
|
||||
def on_touch_move(self, touch):
|
||||
if touch.x < self.width/3:
|
||||
self.player1.center_y = touch.y
|
||||
|
|
Loading…
Reference in New Issue