Rabbyt: a fast sprite library for Python
Rabbyt:パイソンのための速いスプライト図書館
Rabbyt is a sprite library for Python with game development in mind. It has
two goals:
Rabbytは、ゲーム開発が心にあるパイソンのためのスプライト図書館です。それは、2ゴールをとります:
- Be fast, without sacrificing ease of use.
使いやすさを犠牲にすることなく、速くしてください。- Be easy to use, without sacrificing speed.
速度を犠牲にすることなく、使いやすくしてください。
Download
ダウンロード
You may always download the latest release of Rabbyt on it's cheeseshop page.
あなたは、それの上のRabbytの最新の発散がcheeseshopページであることを常にダウンロードするかもしれません。
You can get the latest development version of rabbyt using mercurial:
あなたは、水銀剤を使っているrabbytの最新の事情バージョンを得ることができます:
$ hg clone http://matthewmarshall.org/projects/rabbyt/hg.cgi rabbyt_dev
$ hgクローンhttp://matthewmarshall.org/projects/rabbyt/hg.cgi rabbyt_dev
Additionally you can browse the mercurial repository online.
その上、あなたは移り気な貯蔵所をオンラインで閲覧することができます。
Documentation
ドキュメンテーション
By popular demand, (or rather, by necessity,) you can now browse the
rabbyt documentation online!
人気がある需要によって、あなたは現在rabbytドキュメンテーションをオンラインで閲覧することができます(または、むしろ、必然的に)!
Current Features
現在の特集
Rabbyt is early in development, but there is already a lot it can help with.
Rabbytは開発において早いです、しかし、それが手伝うことができる多くがすでにあります。
Sprites
妖精
Sprites are easy! You can create one by just specifying a texture:
妖精は簡単です!あなたは、ちょうどテクスチャーを指定することによって、1つをつくることができます:
car = rabbyt.Sprite("car.png")
車= rabbyt.Sprite(「car.png」)![]()
Rotating and scaling are hardware accelerated, and easy!
回転することとスケーリングは速められるハードウェアです、そして、簡単です!
car.rot = 45 car.scale = 0.5
car.rot = 45 car.scale = 0.5![]()
Animations
アニメーション
Animating is common need for game graphics, and doing a large number of them
in python can get slow. Rabbyt provides a set of Anim (short for
animator) classes to calculate common animations in C. For example, you can
slowly fade out the car sprite like this:
活
気づけることはゲーム・グラフィックスの一般の必要です、そして、パイソンで彼らのかなりの数をすることは遅くなることができます。Rabbytは、Cで
一般のアニメーションを計算するために、一連のAnim(アニメーターの省略の)クラスを提供します。たとえば、あなたはこのように自動車スプライトを
ゆっくりフェードアウトさせることができます:
car.alpha = rabbyt.lerp(1.0, 0.0, dt=1.0)
car.alpha = rabbyt.lerp(1.0、0.0、dt=1.0)
That will linearly interpolate the sprite's alpha from 1.0 to 0.0
over the next 1 second. This both easy to use, (you just set it and
forget it,) and fast (it all happens in C code.)
それは、次の1秒の間、1.0から0.0まで妖精のアルファを線形に改変します。使うのが簡単なこんなに両方とも∥(あなたはちょうどそれをセットして、それを忘れます)、そして、速い(それは、Cコードですべて起こります。)
Take a look at the lotsofsprites.py example in the Rabbyt download. It makes
use of anims for the position, rotation, scaling, and color of 2400
sprites. And it runs fast.
Rabbytダウンロードにおいてlotsofsprites.py例を見てください。それは、2400匹の妖精の位置、回転、スケーリングと色のためにanimsを利用します。そして、それは速く走ります。
Collision Detection
衝突発見
Collision detection is another thing that is difficult to do in pure python.
Rabbyt can do the tedious part for you. Just pass
rabbyt.collisions.collide() a list of anything that has x, y, and
bounding_radius attributes (like a sprite) and you'll get back a list of
collisions. (Ok, that sounds a little corny after I wrote it, but whatever.)
衝
突発見は、純粋なパイソンでするのが難しいもう一つのことです。Rabbytは、あなたのために退屈な部分をすることができます。ちょっと
rabbyt.collisions.collide()にx、yとbounding_radius特質(妖精のような)がある何のリストでも渡してくだ
さい、そして、あなたは衝突のリストを取り戻します。(私がそれ、しかし、同類を書いたあと、少しありきたりに聞こえるOk。)
Check out the collision.py example to see how fast it is. On my machine,
it takes an average of 1 millisecond to do a brute force collision check between
400 sprites.
それがどれくらい速いかについて見るために、collision.py例をチェックしてください。私の機械で、400匹の妖精の間で暴力衝突チェックをするために、平均1ミリ秒かかります。
Mailing List
メーリングリスト
There is a Google Group set up here. This is the place to go if you need
help.
ここで設立されるGoogleグループが、あります。あなたが援助を必要とするならば、これは行くための場所です。
Or you can contact me directly. I don't bite :)
または、あなたは直接私と連絡をとることができます。私は、噛みません:)
What's up with the name?
名前はどうした?
Well, both of the goals are to be fast, like rabbits. Also, there is another
cool multimedia library for python called Pyglet, and Rabbyt just seemed
to follow. If you're looking to name your own library, consider Wynnye or
Tygger or Chrystopher Robbyn. Tygger especially would make a good name for
a physics library.
さて、ウサギのように、ゴールの両方とも、速いことになっています。また、もう一つのいかしたマルチメディアの図書館がPygletと
呼ばれているパイソンのためにあります、そして、Rabbytはちょうどあとに続くようでした。あなたがあなた自身の図書館に名をつけるのを期待している
ならば、WynnyeまたはTyggerまたはChrystopher
Robbynを考慮してください。Tyggerは、特に物理学図書館のために信用を作ります。