[ANN] Kivy 1.0.2-alpha released

45 megtekintés
Ugrás az első olvasatlan üzenetre

Mathieu Virbel

olvasatlan,
2011. febr. 10. 7:26:242011. 02. 10.
– kivy...@googlegroups.com
We are pleased to present the second alpha of Kivy (1.0.2-alpha)

Kivy is a full featured framework for creating novel and performant
user interfaces, such as multitouch applications, under the LGPL 3
license. The framework work on Windows, MacOSX, Linux and Android.
All downloads are available on the website :

http://kivy.org

Kivy 1.0.2 is in _Alpha_ state, and indented to a _developer
audience_. Please test and report issues at :

http://github.com/tito/kivy/issues.

The final release of Kivy 1.0 is planned on 1st March 2011.

The goal of this release is to spot any issues before the final
release, and motive you to write awesome softwares and games !


Changelog - 1.0.2-alpha
=======================

Core
----

- New kivy.require() method to require a minimum kivy version
- New App.stop() method
- [#22] Autodetection of GLES2 support
- Speedup Kivy language callbacks
- Reduce text memory footprint using new luminance_alpha format
- Remove old vsync/fps token in Configuration, use maxfps.
- FPS is limited to 60 by default now.
- Fixes for pip installer

Graphics
--------

- New Ellipse.segments property
- Support of luminance + luminance_alpha color format in texture
- Speedup of internals classes (VBO, VertexBatch, Buffer)
- [#42, #48] Fixes and activate graphics compiler
- Fixes compilation for Linux + ATI card

Documentation
-------------

- [#54] Enhance Vector documentation
- Installation for Windows, MacOSX, Linux and Android
- Fixes Quickstart

Widgets
-------

- New layouts: FloatLayout, GridLayout and AnchorLayout

Examples
--------

- Fixes for touchtracer to make it run on android

Android
-------

- Initial release of Android Kivy launcher.
- You need Android 2.2 + OpenGL ES 2.0 support
- Tested on Motorola Droid 1, Motorola Droid 2, Samsung Galaxy Tab,
Xperia 10.


--
Mathieu, Christopher and Thomas
http://kivy.org/#aboutus

Mathieu Virbel

olvasatlan,
2011. febr. 10. 7:31:282011. 02. 10.
– kivy...@googlegroups.com
In case of, for people using the GIT version, you must rebuild Kivy completly.
Don't forget -f to force compilation.

$ git pull origin master
$ python setup.py build_ext --inplace -f

2011/2/10 Mathieu Virbel <m...@kivy.org>:

Mathieu Virbel

olvasatlan,
2011. febr. 10. 8:46:382011. 02. 10.
– kivy...@googlegroups.com
Ok, people have reported that current Kivy / android doesn't run. I'm
fixing the issue right now, and will send an email when the update
will be available on market.

2011/2/10 Mathieu Virbel <m...@kivy.org>:

Matthias Georgi

olvasatlan,
2011. febr. 10. 9:08:162011. 02. 10.
– kivy...@googlegroups.com
I downloaded the Windows version and I got the error:

ImportError: No module named event

Is the compiled pyrex dll missing in the windows package?

Mathieu Virbel

olvasatlan,
2011. febr. 10. 10:38:402011. 02. 10.
– kivy...@googlegroups.com
Hi Matthias,

Look like the portable didn't build correctly.
The windows package have been redone, and uploaded.
Thanks for reporting !

Mathieu

2011/2/10 Matthias Georgi <matti....@gmail.com>:

Mathieu Virbel

olvasatlan,
2011. febr. 10. 10:39:242011. 02. 10.
– kivy...@googlegroups.com
Android package have been fixed, and published on market.
The version is 1.0.2-alpha-android-2

Mathieu

2011/2/10 Mathieu Virbel <m...@kivy.org>:

Harsh J

olvasatlan,
2011. febr. 10. 11:52:192011. 02. 10.
– kivy...@googlegroups.com
This is great, thank you for fixing the Android pack! :)

--
Harsh J
www.harshj.com

Matthias Georgi

olvasatlan,
2011. febr. 10. 11:57:072011. 02. 10.
– kivy...@googlegroups.com
I have a general question.

How hard is it to port a pymt app to kivy?

Matthias Georgi

olvasatlan,
2011. febr. 10. 11:58:312011. 02. 10.
– kivy...@googlegroups.com
sorry for accidentally posting on this thread.

Mathieu Virbel

olvasatlan,
2011. febr. 10. 12:01:402011. 02. 10.
– kivy...@googlegroups.com
It's a little hard to say, that's really depend how you've managed
your PyMT app: if you write custom widget, changed a lot the drawing,
using css...

For an app of ~10days of development, i've spend 2 for moving on Kivy,
not completly finished, because i'm still learning how to do.

That's better to restart the ui from scratch instead of trying to
port. If you simply port the app to Kivy, you'll not use the new Kivy
way to do ui, and still think as a PyMT dev. That's the hardest part i
think.

(i know that it will not really answer you, but they are no general
answer... :/)

But don't hesitate to bother us if you have any trouble :)

Mathieu

2011/2/10 Matthias Georgi <matti....@gmail.com>:

Matthias Georgi

olvasatlan,
2011. febr. 10. 12:11:172011. 02. 10.
– kivy...@googlegroups.com
drawing was customized in some places to improve opengl performance.

for example to render all rectangles at once in a button matrix we are
doing this:

def draw_tiles(self):
with gx_begin(GL_QUADS):
for i in range(self.visible_clip_cols()):
for j in range(self.visible_rows):
self.draw_tile(i, j)

Mathieu Virbel

olvasatlan,
2011. febr. 10. 12:29:462011. 02. 10.
– kivy...@googlegroups.com
That's exactly the more complex behavior, the drawing change from conditions.
And every frame, you should check again the condition to know what you
want to draw or not.
In Kivy, that cannot be applied, because Kivy is event based. If you
change something -> you update.
No change -> no update.

On this particular case:

1. i would create all the rectangle at start

from kivy.graphics import Rectangle

class Matrix(Widget):

+ in __init__():
self.grects = gr = {}
for i in range(maxcols):
for j in range(maxrows):
gr[(i, j)] = Rectangle(pos=..., size=...)

2. i would create a custom property for knowing if the row/col is
dipslayed. But we don't have a DictProperty (that could be done.)

from kivy.properties import ObjectProperty

class Matrix(Widget):
visible_grid = ObjectProperty({})

+ attach event that remove all rectangle on canvas, and reattach only
the visible one

def on_visible_grid(self, instance, value):
# visible grid changed.
self.canvas.clear()
for key, value in value.iterkeys():
if value:
self.canvas.add(self.grects[key])


=> Then, to use it:

wid = Matrix()
grid = wid.visible_grid
grid[(10, 5)] = True

# update the grid
wid.visible_grid = grid

grid[(1, 2)] = True
grid[(10, 2)] = True
grid[(10, 5)] = Fals

# update the grid
wid.visible_grid = grid


The assignment of wid.visible_grid = grid could be removed in a
future, but right now, that's the only way we have to detect that the
content of the property changed.

More reading available at :
http://kivy.org/docs/api-kivy.properties.html
http://kivy.org/docs/api-kivy.uix.widget.html#usage-of-properties

Read also the Image source code, that may be the simplest widget done,
and using the power of properties.

2011/2/10 Matthias Georgi <matti....@gmail.com>:

Mathieu Virbel

olvasatlan,
2011. febr. 10. 12:51:472011. 02. 10.
– kivy...@googlegroups.com
Matthias: http://paste.pocoo.org/show/335968/

Just a very quick test, working, not commented, use with care :)


2011/2/10 Mathieu Virbel <m...@kivy.org>:

Matthias Georgi

olvasatlan,
2011. febr. 10. 16:56:252011. 02. 10.
– kivy...@googlegroups.com
Wow, thanks Mathieu, very detailed answer.

The example is indeed very insightful.I think I understand the new mechanism.

still some questions:

1. Is there some kind of render thread? I'm asking because of the
schedule functions.

2. I understand the reason for triggering the canvas interaction, but
not for triggerering the rectangle creation. Why is this asynchronous?

3. How is the supposed interaction, if you have several widgets which
can change the layout? It could be complicated to find out, what
widget needs to be redrawn.

4. Do you sort the render commands? e.g. draw all rectangles in one
batch to avoid opengl state changes.

Matthias

Christopher Denter

olvasatlan,
2011. febr. 10. 17:09:042011. 02. 10.
– kivy...@googlegroups.com
I will just go ahead and answer 1 and 4:

1) Not yet; But that is a possible future optimization we will look into.
4) Kivy has this new concept of 'Graphics Compilers'.
I.e. if you use the new graphics API (the canvas stuff) then a bunch of compilers will look at what is about to be drawn and optimize the way it is drawn.
E.g. you draw 1000 rectangles. It will detect that and batch-draw them. Or say you have many many tiny textures. A compiler could detect that, put them into one large texture atlas and use that instead.

Note, however, that there are no really sophisticated compilers available yet.
Right now we're finalizing and stabilizing the API for the release next month.
Adding compilers can be done without breaking existing code.

If you use GL directly you'll obviously have to take care of calling it efficiently yourself.
Or you contribute compilers and make everyone happy. :-)


Christopher

Mathieu Virbel

olvasatlan,
2011. febr. 10. 17:16:122011. 02. 10.
– kivy...@googlegroups.com
2011/2/10 Matthias Georgi <matti....@gmail.com>:

> Wow, thanks Mathieu, very detailed answer.
>
> The example is indeed very insightful.I think I understand the new mechanism.
>
> still some questions:
>
> 1. Is there some kind of render thread? I'm asking because of the
> schedule functions.
>
> 2. I understand the reason for triggering the canvas interaction, but
> not for triggerering the rectangle creation. Why is this asynchronous?

It's asynchronous because of properties observer -> handler.
Just imagine that you are creating a Matrix(cols=50,rows=10,squaresize=88)
Theses 3 properties are changing the rectangles primitives right ?
So, each time one of theses properties change, you must change primitives too.
In the example, we are recreating all of them (easier to write, not
exactly the best in term of performance)

So, why asynchronous ? Because when you change a property, the trigger
will be called immediatly.
So in creation, your object will just assign cols=50 -> trigger creation
then rows=10 -> trigger creation
then squaresize=88 -> trigger creation.

That will be the same if you are have your widget, and doing:
wid = Matrix()
wid.rows = 10 # trigger creation
wid.squaresize = 99 # trigger creation again

So, by scheduling the creation only once at next iteration, you avoid
creation/deletion.
(That's the first time i'm trying to describe this behavior, hope that
is understandable.)

>
> 3. How is the supposed interaction, if you have several widgets which
> can change the layout? It could be complicated to find out, what
> widget needs to be redrawn.

I don't understand clearly the questions. But except your example with
MAtrix class, you can use our Kivy Language for describing drawing of
UI.

Let's say you've a CustomWidget with a property state, that can be
"down" or "normal".
With kivy language, you can use a file like this:

#:kivy 1.0
<CustomWidget>:
canvas:
Color:
rgb: (1, 0, 0) if self.state == 'normal' else (0, 1, 0)
Rectangle:
pos: self.pos
size: self.size


I think you can understand easily the file. This will be automatically
applied on every CustomWidget you'll create, and automatically adapt
Rectangle pos if the widget pos change, adapt color if the state
property change etc.

You can read more about the lang here : http://kivy.org/docs/api-kivy.lang.html

Matthias Georgi

olvasatlan,
2011. febr. 10. 17:16:432011. 02. 10.
– kivy...@googlegroups.com
thanks for the fast answer. sounds exciting.
if needed, I would contribute a compiler.
we had also performance problems with text labels.
are they optimized as textures right now?
how is the canvas backend for android?
Is this just plain opengl?
main motivation for porting to kivy would be the oppurtunity to
release on android.

Matthias

Christopher Denter

olvasatlan,
2011. febr. 10. 17:25:032011. 02. 10.
– kivy...@googlegroups.com
Yes, internally we still do all the drawing with OpenGL obviously.

Not sure if that is what you meant.

Mathieu Virbel

olvasatlan,
2011. febr. 10. 17:25:222011. 02. 10.
– kivy...@googlegroups.com
2011/2/10 Matthias Georgi <matti....@gmail.com>:

> thanks for the fast answer. sounds exciting.
> if needed, I would contribute a compiler.

That's would be appreciated, we really need more work on that :)

> we had also performance problems with text labels.
> are they optimized as textures right now?

Text label are texture, as PyMT before yes.
But when you said you've performance trouble, is it on desktop, or android ?

> how is the canvas backend for android?
> Is this just plain opengl?

Same as desktop. Exactly the same code.

> main motivation for porting to kivy would be the oppurtunity to
> release on android.

Same for me :) Android platform (at least on my phone) is not perfect,
but exist. This is the first release, and we've focus our work of
making a new way of making UI, event, shader etc. Now that's normal
that we hit some performance issue (even if it would be not the case),
mainly because we need to check more our internals, compiler, prevent
too much compilation etc..

Matthias Georgi

olvasatlan,
2011. febr. 11. 11:28:582011. 02. 11.
– kivy...@googlegroups.com
Thanks for the kind answers.
The new architecture looks very promising.
While finishing our app in pymt, I will play around with kivy, try
porting some of the classes.
I think porting wont be a big deal, but I wait til things settle down.

Cheers Matthias

Válasz mindenkinek
Válasz a szerzőnek
Továbbítás
0 új üzenet