日誌2011-12-19 23:45
【RMXP小研究】地圖新增遮罩圖層增加畫面變化(修正)作者:月見斐夜
# 生成遠景層 @panorama = Plane.new(@viewport1) @panorama.z = -1000 |
# 生成遮罩層 @ground = Plane.new(@viewport1) @ground.z = 3000 |
# 釋放遠景層 @panorama.dispose |
# 釋放遮蓋圖層 @ground.dispose |
# 刷新遠景層 @panorama.ox = $game_map.display_x / 4 @panorama.oy = $game_map.display_y / 4 |
# 刷新遮罩層 @ground.tone = $game_screen.tone if @ground.ox != -$game_map.display_x / 256 or @ground.oy != -$game_map.display_y / 256 or @ground.ox == 0 or @ground.oy == 0 @ground.ox = $game_map.display_x / 4 @ground.oy = $game_map.display_y / 4 end |
module RPG module Cache def self.overlay(filename) self.load_bitmap("Graphics/Overlays/", filename) end end end |
# 生成遮罩層 # 確認檔案是否存在 @GroundON = FileTest.exist?("Graphics/Overlays/" + "ground" + $game_map.map_id.to_s + ".png") # 如果檔案存在的情況下 if @GroundON # 生成圖層 @ground = Plane.new(@viewport1) @ground.z = 3000 # 檔案名稱規格化 @ground.bitmap = RPG::Cache.overlay("ground" + $game_map.map_id.to_s) end |
# 釋放遮蓋圖層 if @ground != nil # 檔案不為「無」的情況下 @ground.dispose end |
if @ground != nil # 檔案不為「無」的情況下 # 刷新遮罩層 @ground.tone = $game_screen.tone if @ground.ox != -$game_map.display_x / 256 or @ground.oy != -$game_map.display_y / 256 or @ground.ox == 0 or @ground.oy == 0 @ground.ox = $game_map.display_x / 4 @ground.oy = $game_map.display_y / 4 end end |
module RPG_FileTest def RPG_FileTest.overlay_exist?(filename) return RPG::Cache.overlay(filename) rescue return false end end |
@GroundON = FileTest.exist?("Graphics/Overlays/" + "ground" + $game_map.map_id.to_s + ".png") |
@GroundON = RPG_FileTest.overlay_exist?("ground" + $game_map.map_id.to_s + ".png") |
2011-12-20 20:22月見斐夜:這種方式用得好的話...可以做出很噁心的偽3D...
2011-12-20 20:23月見斐夜:?!!!!!!![e17]
2011-12-24 23:29月見斐夜:這遊戲出來不是神作就是坑(被巴
2011-12-24 23:30月見斐夜:其實作法不難,可以作出很多層,戰鬥畫面也是同樣道理
2011-12-24 23:31月見斐夜:這種作法在外國的VX遊戲上很常見,可是我們這邊好像沒有見過...?
2011-12-24 23:33月見斐夜:在一開始生成的地方新增@ground.blend_type = 1
0為普通,1為加法,2為減法
2012-01-14 23:25月見斐夜:改Z值就可以了,不過不要太低,不然遮不到建築物
2012-02-01 17:40月見斐夜:我也有碰下ACE,雖然地圖資料庫的分類變得跟XP一樣,可是畫地圖時曬只有一層,不習慣= ="
但是ACE在RGSS3上的寫法比前兩代都高端很多(我覺得最爛的是VX的)
還有就是很獵奇的臉圖生成器,這東西告訴我們人體鍊成果然是被禁止的=__=
2012-02-12 17:49月見斐夜:ACE的語法還有層別內的分別都跟XP大大不同,在這邊不太好解釋,我有空幫你弄套插件式的腳本好了(汗)
2012-02-18 20:13月見斐夜:阿咧?!
好險我還沒開始寫.....(靠