• Anmelden

1

Samstag, 4. April 2015, 23:09

BigIcon Menü für den RPG Maker VX Ace

Hallo, wo Shab heute meinte das Achievementsystem wäre endlich mal ein Skript das die BigIcons nutzt fiel mir ein, das ich hier garnicht mein BigIcon-Menü vorgestellt habe, was ich damals für die Jungs und Mädchen von RPGMakerWEB geschrieben habe. Skandalös, dass dies total untergegangen ist!

Hier ist erstmal die VX Ace Version, ich habe das auch irgendwo für den RMXP angefangen aber finde gerade das Projekt nicht wieder. :pardon: Das kommt aber noch!

Ich freue mich über Kommentare und Anregungen, damit die BigIcons auch mehr Öffentlichkeit abbekommen. ;)

:presentation: Intro


Gerade wenn euer Spiel eher wenig Items/Waffen/Rüstungen enthält sieht das Menü immer schrecklich leer aus - das ist für mich der Moment wo ich BigIcons empfehle, was im Prinzip normale Icons sind - aber in groß. Verschiedene Ressourcenersteller (zum Beispiel Avery, PandaMaru, slimmeiske2, EvilEagles etc.) führen in ihrem Portfolio solche (Stand April 2015, liegt die Anzahl bei knapp 200 meines Wissens nach).
Dieses Skript ermöglicht euch diese großen und detailierteren (auch ein Empfehlungsgrund) Icons für Waffen, Rüstungen und Items einzusetzen - wie das im Menü dann aussieht, seht ihr in den folgenden Screenshots:
Spoiler: :image: Screenshots aus der Demo


Bild

Bild

Bild

Bild

zum Lesen den Text mit der Maus markieren


:wrench-screwdriver: Benutzung im RPG Maker VX Ace


  1. Das Skript unter Materials einfügen.
  2. Die BigIcons im normalen Iconraster ins Set einfügen und für Waffen, Rüstungen und Items jeweils die obere linke Ecke auswählen - das Skript erledigt den Rest.


:ruby: Quellcode


Der Quellcode entspricht dem Beitrag zum MakerWEB-Restaff, lediglich das Einstiegskommentar und die Nutzungsbedinungen wurde ins Deutsche übersetzt/angepasst.
Spoiler: Sourcecode VX Ace

Ruby Quellcode

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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
#==============================================================================
# ** Size does matter at all
#------------------------------------------------------------------------------
#  Dieses Skript ermöglicht große 48x48px Icons in euren VX Ace Projekten zu
#  verwenden. Richte die Icons im normalen 24x24 Raster aus und wähle immer
#  die obere linke Ecke des Icons für Items, Waffen und Rüstungen. Das Skript
#  wählt dann automatisch die restlichen Parts des BigIcons rechts, unten und
#  unten-rechts und kombiniert diese.
#  Man kann immernoch die normalen Icons für Zauber und Textnachrichten oder
#  in eigenen Skripten benutzen.
#  
#  - erstellt für den Restaff auf forums.rpgmakerweb.com -
#------------------------------------------------------------------------------
#  Autor: Playm
#  Datum: Februar 2015
#  Maker: RPG Maker VX Ace
#  Einfache Nutzung in nicht-kommerziellen VX Ace Projekten ist gestattet.
#  Keine kommerzielle Nutzung gestattet. Für Lizenzen an den Autor wenden.
#  Keine Weiterverbreitung in originaler oder abgeänderter Form gestattet.
#==============================================================================
# ** Window_Base
#==============================================================================
class Window_Base
  #--------------------------------------------------------------------------
  # * Draw Big Icon with an source rect width and height of 48 pixels
  #     enabled : Enabled flag. When false, draw semi-transparently.
  #--------------------------------------------------------------------------
  def draw_big_icon(icon_index, x, y, enabled = true)
    bitmap = Cache.system("Iconset")
    rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 48, 48)
    contents.blt(x, y, bitmap, rect, enabled ? 255 : translucent_alpha)
  end
  #--------------------------------------------------------------------------
  # * Seperator
  #--------------------------------------------------------------------------
  def item_name_seperator
    return "\n"
    return ": "
  end
end
#==============================================================================
# ** Window_ItemList
#==============================================================================
class Window_ItemList
  #--------------------------------------------------------------------------
  # * Get Line Height
  #--------------------------------------------------------------------------
  def item_height
    return 48
  end
  #--------------------------------------------------------------------------
  # * Get Digit Count
  #--------------------------------------------------------------------------
  def col_max
    return 7
  end
  #--------------------------------------------------------------------------
  # * Draw Item
  #--------------------------------------------------------------------------
  def draw_item(index)
    item = @data[index]
    if item
      rect = item_rect(index)
      draw_big_icon(item.icon_index, rect.x, rect.y, enable?(item))
      draw_item_number(rect, item)
    end
  end
  #--------------------------------------------------------------------------
  # * Draw Number of Items
  #--------------------------------------------------------------------------
  def draw_item_number(rect, item)
    x, y = rect.x, rect.y + rect.height - line_height
    draw_text(x, y, rect.width, line_height,
              sprintf("%2d", $game_party.item_number(item)), 2)
  end
  #--------------------------------------------------------------------------
  # * Update Help Text
  #--------------------------------------------------------------------------
  def update_help
    @help_window.set_text(
                   item ? item.name+item_name_seperator+item.description : '')
  end
end
#==============================================================================
# ** Window_EquipSlot
#==============================================================================
class Window_EquipSlot
  #--------------------------------------------------------------------------
  # * Draw Item
  #--------------------------------------------------------------------------
  def draw_item(index)
    return unless @actor
    change_color(system_color, enable?(index))
    align = index < 3 ? 1 : (index == 3 ? 2 : 0)
    draw_text(item_rect_for_text(index), slot_name(index), align)
    return if @actor.equips[index].nil?
    rect = item_rect(index)
    draw_big_icon(@actor.equips[index].icon_index, rect.x, rect.y, enable?(index))
  end
  #--------------------------------------------------------------------------
  # * Get Rectangle for Drawing Items
  #--------------------------------------------------------------------------
  def item_rect(index)
    rect = Rect.new( 0, 0, item_width, item_height)
    column_width = contents_width / 3
    case index
    when 0,1,2
      rect.x = column_width * index + (column_width - item_width) / 2
    when 3
      rect.x = (contents_width - spacing) / 2 - item_width
    when 4
      rect.x = (contents_width + spacing) / 2
    end
    rect.y = index / 3 * item_height + line_height
    rect
  end
  #--------------------------------------------------------------------------
  # * Get Rectangle for Drawing Items (for Text)
  #--------------------------------------------------------------------------
  def item_rect_for_text(index)
    rect = Rect.new
    first_row_column_width = contents_width / 3
    second_row_column_width = (contents_width - spacing) / 2
    case index
    when 0,1,2
      rect.x = first_row_column_width * index
      rect.y = 0
      rect.width = first_row_column_width
    when 3,4
      rect.x = (second_row_column_width + spacing + item_width) * (index / 4)
      rect.y = line_height + item_height + (item_height - line_height) / 2
      rect.width = second_row_column_width - item_width
    end
    rect.height = line_height
    rect
  end
  #--------------------------------------------------------------------------
  # * Get Item Width
  #--------------------------------------------------------------------------
  def item_width
    return 48
  end
  #--------------------------------------------------------------------------
  # * Get Item Height
  #--------------------------------------------------------------------------
  def item_height
    return 48
  end
  #--------------------------------------------------------------------------
  # * Update Bottom Padding
  #--------------------------------------------------------------------------
  def update_padding_bottom
    self.padding_bottom = standard_padding
  end
  #--------------------------------------------------------------------------
  # * Calculate Height of Window Contents
  #--------------------------------------------------------------------------
  def contents_height
    height - standard_padding * 2
  end
  #--------------------------------------------------------------------------
  # * Get Window Height
  #--------------------------------------------------------------------------
  def window_height
    return 144
  end
  #--------------------------------------------------------------------------
  # * Get Digit Count
  #--------------------------------------------------------------------------
  def col_max
    return 3
  end
  #--------------------------------------------------------------------------
  # * Update Help Text
  #--------------------------------------------------------------------------
  def update_help
    super
    if @help_window
      @help_window.set_text(
                  item ? item.name+item_name_seperator+item.description : '')
    end
    @status_window.set_temp_actor(nil) if @status_window
  end
end
#==============================================================================
# ** Window_ShopBuy
#==============================================================================
class Window_ShopBuy
  #--------------------------------------------------------------------------
  # * Get Line Height
  #--------------------------------------------------------------------------
  def item_height
    return 48
  end
  #--------------------------------------------------------------------------
  # * Get Digit Count
  #--------------------------------------------------------------------------
  def col_max
    return 4
  end
  #--------------------------------------------------------------------------
  # * Draw Item
  #--------------------------------------------------------------------------
  def draw_item(index)
    item = @data[index]
    rect = item_rect(index)
    draw_big_icon(item.icon_index, rect.x, rect.y, enable?(item))
    px, py = rect.x, rect.y + rect.height - line_height
    draw_text( px, py, rect.width, line_height, price(item), 2)
  end
  #--------------------------------------------------------------------------
  # * Update Help Text
  #--------------------------------------------------------------------------
  def update_help
    @help_window.set_text(
                   item ? item.name+item_name_seperator+item.description : '')
  end
end
#==============================================================================
# ** Window_ShopNumber
#==============================================================================
class Window_ShopNumber
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    contents.clear
    draw_big_icon(@item.icon_index, 0, item_y-12, true)
    change_color(normal_color)
    draw_text(52, item_y, cursor_x-48-22-4, line_height, @item.name)
    draw_number
    draw_total_price
  end
end
#==============================================================================
# ** Window_Status
#==============================================================================
class Window_Status
  #--------------------------------------------------------------------------
  # * Draw Block 3
  #--------------------------------------------------------------------------
  def draw_block3(y)
    draw_parameters(32, y)
    draw_equipments(224, y)
  end
  #--------------------------------------------------------------------------
  # * Draw Equipment
  #--------------------------------------------------------------------------
  def draw_equipments(x, y)
    box = Rect.new( x, y, contents_width - x, 96 )
    5.times{ |i| draw_equipment_item( i, box) }
  end
  #--------------------------------------------------------------------------
  # * Draw Item
  #--------------------------------------------------------------------------
  def draw_equipment_item(index,box)
    item = @actor.equips[index]
    return unless item
    x  = box.x + (index % 2) * (box.width - 48)
    y  = box.y + (index / 2) * 48 + (index % 2) * 24
    nx = box.x + 48
    ny = box.y + (index / 2) * 48 + (index % 2) * 24
    align = (index % 2) * 2
    draw_big_icon(item.icon_index, x, y, true)
    draw_text( nx, ny, box.width - 96, 24, item.name, align)
  end
end
#==============================================================================
# ** Scene_Item
#==============================================================================
class Scene_Item
  #--------------------------------------------------------------------------
  # * Create Help Window
  #--------------------------------------------------------------------------
  def create_help_window
    @help_window = Window_Help.new(3)
    @help_window.viewport = @viewport
  end
end
#==============================================================================
# ** Scene_Equip
#==============================================================================
class Scene_Equip
  #--------------------------------------------------------------------------
  # * Create Help Window
  #--------------------------------------------------------------------------
  def create_help_window
    @help_window = Window_Help.new(3)
    @help_window.viewport = @viewport
  end
end
#==============================================================================
# ** Scene_Shop
#==============================================================================
class Scene_Shop
  #--------------------------------------------------------------------------
  # * Create Help Window
  #--------------------------------------------------------------------------
  def create_help_window
    @help_window = Window_Help.new(3)
    @help_window.viewport = @viewport
  end
end
zum Lesen den Text mit der Maus markieren

Social Bookmarks