• R/O
  • SSH
  • HTTPS

dxruby: Commit


Commit MetaInfo

Revisión216 (tree)
Tiempo2011-10-24 20:05:37
Autormirichi

Log Message

ライセンス表記とサンプルのアップデート

Cambiar Resumen

Diferencia incremental

--- trunk/sample/readme_sample.txt (revision 215)
+++ trunk/sample/readme_sample.txt (revision 216)
@@ -16,7 +16,7 @@
1616 ・・・砂が降ってくるデモです。マウスでいじってください。
1717
1818 drawtile
19- ・・・Window.drawTileとWindow.setViewportのデモ。マップの2レイヤ描画をしています。
19+ ・・・Window.drawTileとRenderTargetクラスのデモ。マップの2レイヤ描画をしています。
2020
2121 flight
2222 ・・・空を飛んでるっぽい疑似3D表現のサンプルです。カーソルキーで動きます。
@@ -45,3 +45,6 @@
4545 dxrubyex_sample2
4646 ・・・同梱のDXRubyExtensionのサンプルその2です。
4747
48+laser
49+ ・・・DXRubyExtensionを使ってレーザーを実装してみたサンプルです。
50+
--- trunk/sample/drawtile.rb (revision 215)
+++ trunk/sample/drawtile.rb (revision 216)
@@ -1,4 +1,5 @@
11 # マップデータから背景描画サンプル
2+# RenderTargetクラスの使い方のサンプルになっています。
23 require 'dxruby'
34
45 # マップデータ
@@ -37,7 +38,7 @@
3738 [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
3839 ]
3940
40-# 手前に描画する用のマップデータ(4は木のあたま。nilにすると描画しない)
41+# 手前に描画する用の上層マップデータ(4は木のあたま。nilにすると描画しない)
4142 map2 = [
4243 [nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 4, nil, nil, nil],
4344 [nil, 4, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 4, nil, nil, nil, nil, nil],
@@ -108,10 +109,12 @@
108109 # 移動カウント
109110 count = 0
110111
111-# ビューポート設定
112-Window.setViewport(32, 32, 640-64, 480-64)
112+# RenderTarget作成
113+rt_main = RenderTarget.new(640-64, 480-64)
114+rt_sub = RenderTarget.new(640-64, 480-64)
113115
114116 Window.loop do
117+
115118 # 移動中はカウントアップするだけ
116119 if state == 1 then
117120 count = count + 4 # カウントアップ
@@ -146,18 +149,25 @@
146149 end
147150 end
148151
149- # 優先順位を変えて2回描画することで、キャラより手前にマップチップを描画することもできます。
150- # ベースマップ描画
151- Window.drawTile(32, 32, map1, mapimage, (x - 8.5) * 32 + count * dx, (y - 6) * 32 + count * dy, 18, 13, 0) # 優先順位0
152+ # ベースマップをrt_mainに描画
153+ rt_main.drawTile(0, 0, map1, mapimage, (x - 8.5) * 32 + count * dx, (y - 6) * 32 + count * dy, 18, 13)
154+ rt_main.update
152155
153- # 人より手前に描画するマップ
154- Window.drawTile(32, 32, map2, mapimage, (x - 8.5) * 32 + count * dx, (y - 6) * 32 + count * dy, 18, 13, 2) # 優先順位2
156+ # 上層マップをrt_subに描画
157+ rt_sub.drawTile(0, 0, map2, mapimage, (x - 8.5) * 32 + count * dx, (y - 6) * 32 + count * dy, 18, 13)
158+ rt_sub.update
155159
160+ # ベースマップを画面に描画
161+ Window.draw(32, 32, rt_main)
162+
156163 # 人描画
157- Window.draw(9.5 * 32, 7 * 32 - 16, image, 1) # 人は優先順位をマップの間にしておく
164+ Window.draw(9.5 * 32, 7 * 32 - 16, image)
158165
166+ # 上層マップを画面に描画
167+ Window.draw(32, 32, rt_sub)
168+
159169 # エスケープキーで終了
160170 break if Input.keyPush?(K_ESCAPE)
161- Window.drawFont(32,32,Window.fps.to_s + " fps", font, :z=>3)
162- Window.drawFont(32,64,Window.getLoad.to_i.to_s + " %", font, :z=>3)
171+ Window.drawFont(32,32,Window.fps.to_s + " fps", font)
172+ Window.drawFont(32,64,Window.getLoad.to_i.to_s + " %", font)
163173 end
--- trunk/COPYING (revision 215)
+++ trunk/COPYING (revision 216)
@@ -1,21 +1,13 @@
1-The MIT License
1+The zlib/libpng License
2+Copyright (c) <2011> <mirichi>
23
3-Copyright (c) 2009 mirichi
4+This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
45
5-Permission is hereby granted, free of charge, to any person obtaining a copy
6-of this software and associated documentation files (the "Software"), to deal
7-in the Software without restriction, including without limitation the rights
8-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9-copies of the Software, and to permit persons to whom the Software is
10-furnished to do so, subject to the following conditions:
6+Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
117
12-The above copyright notice and this permission notice shall be included in
13-all copies or substantial portions of the Software.
8+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
149
15-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21-THE SOFTWARE.
10+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
11+
12+3. This notice may not be removed or altered from any source distribution.
13+
--- tags/1.2.0/COPYING (revision 215)
+++ tags/1.2.0/COPYING (revision 216)
@@ -1,21 +1,13 @@
1-The MIT License
1+The zlib/libpng License
2+Copyright (c) <2011> <mirichi>
23
3-Copyright (c) 2009 mirichi
4+This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
45
5-Permission is hereby granted, free of charge, to any person obtaining a copy
6-of this software and associated documentation files (the "Software"), to deal
7-in the Software without restriction, including without limitation the rights
8-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9-copies of the Software, and to permit persons to whom the Software is
10-furnished to do so, subject to the following conditions:
6+Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
117
12-The above copyright notice and this permission notice shall be included in
13-all copies or substantial portions of the Software.
8+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
149
15-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21-THE SOFTWARE.
10+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
11+
12+3. This notice may not be removed or altered from any source distribution.
13+
Show on old repository browser