1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
| module RPG
class TilesetVX
attr_accessor :name
attr_accessor :bitmapNames
attr_accessor :passages
def initialize(name,bitmapNames,passages)
@name=name
@bitmapNames=bitmapNames
@passages=passages
end
end
end
def loadTileset(name)
begin
return Cache.load_bitmap("Graphics/Tilesets/",name)
rescue RGSSError, Errno::ENOENT
return Cache.system(name)
end
end
class Spriteset_Map
def create_tilemap
if !$data_map_tilesets
begin
$data_map_tilesets=load_data("Data/MapTilesets.rvdata")
rescue
$data_map_tilesets=nil
end
end
if !$data_tilesets
begin
$data_tilesets=load_data("Data/Tilesets.rvdata")
rescue
$data_tilesets=nil
end
end
@tilemap = Tilemap.new(@viewport1)
tileset=nil
if $data_map_tilesets && $data_tilesets
mapset=$data_map_tilesets[$game_map.map_id]
tileset=$data_tilesets[mapset] if mapset && mapset>0
end
if tileset
@tilemap.bitmaps[0] = loadTileset(tileset.bitmapNames[0])
@tilemap.bitmaps[1] = loadTileset(tileset.bitmapNames[1])
@tilemap.bitmaps[2] = loadTileset(tileset.bitmapNames[2])
@tilemap.bitmaps[3] = loadTileset(tileset.bitmapNames[3])
@tilemap.bitmaps[4] = loadTileset(tileset.bitmapNames[4])
@tilemap.bitmaps[5] = loadTileset(tileset.bitmapNames[5])
@tilemap.bitmaps[6] = loadTileset(tileset.bitmapNames[6])
@tilemap.bitmaps[7] = loadTileset(tileset.bitmapNames[7])
@tilemap.bitmaps[8] = loadTileset(tileset.bitmapNames[8])
@tilemap.passages = tileset.passages
else
@tilemap.bitmaps[0] = Cache.system("TileA1")
@tilemap.bitmaps[1] = Cache.system("TileA2")
@tilemap.bitmaps[2] = Cache.system("TileA3")
@tilemap.bitmaps[3] = Cache.system("TileA4")
@tilemap.bitmaps[4] = Cache.system("TileA5")
@tilemap.bitmaps[5] = Cache.system("TileB")
@tilemap.bitmaps[6] = Cache.system("TileC")
@tilemap.bitmaps[7] = Cache.system("TileD")
@tilemap.bitmaps[8] = Cache.system("TileE")
@tilemap.passages = $game_map.passages
end
@tilemap.map_data = $game_map.data
end
end
#==============================================================================
# ** Main
#------------------------------------------------------------------------------
# After defining each class, actual processing begins here.
#==============================================================================
unless Font.exist?("UmePlus Gothic")
print "Le fichier Font 'UmePlus Gothic' n'a pas été trouvé"
exit
end
begin
Graphics.freeze
$scene = Scene_Title.new
$scene.main while $scene != nil
Graphics.transition(30)
rescue Errno::ENOENT
filename = $!.message.sub("No such file or directory - ", "")
print("Le ficher #{filename} n'a pas été trouvé.")
end |