• Anmelden
  • »MinekTerra« ist der Autor dieses Themas

Motto: Aus Fehlern lernt man

  • Nachricht senden

1

Samstag, 6. November 2010, 15:12

Suche EXP Balkenanzeige

Hi Leute!

Ich suche ein Script, das sofort einsatzbereit ist. Naja es geht um ein EXP Balkenanzeigescript.
Es sollte auch den Wert anzeigen. Nur die Erfahrungspunkte. Das ganze sollte die Maße von etwa
100x400 haben. Wenn jemand so ein Script hat, oder sowas vielleicht machen kann, da ich in
Scripten nicht so geübt bin, dann währe ich demjenigne sehr dankbar. Wenn jemand dafür eine
Gegenleistung haben will, kann sich gerne bei mir melden. Der Name des Scripters wird natürlich
in den Credits erwähnt. :thumbsup:

MFG
Dominik
Bild :yahoo!:
By MinekTerra

Yuber

Seher

Motto: Die Welt zu beherrschen.

  • Nachricht senden

2

Samstag, 6. November 2010, 15:40

Probier das mal aus:

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
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
#===========================================================================
# *** HP/MP/ATB/LimitBreak bar Slanted Style Compatible with RTAB ***
# *** Version 2.1
#---------------------------------------------------------------------------
# by Clive 
# based on Cogwheel's Bars and Sephiroth Spawn's Slanted Bars.
#---------------------------------------------------------------------------
# ----- GREAT THANKS to DerVVulfman for solving the lag problem
#------This is a plug and play script so it should work without any problem!
#=============================================================================
 
# If using with Limit Break, must paste BELOW the Limit Break script as it re-
# writes the 'Gauge drawing' system.  Will cause an error if not properly put.
 
# If used with Trickster's STEAL SCRIPT version 6 R1 (revision 1), then the
# height of RTAB's AT Bar (Draw Actor ATG) may not be smaller than 5 pixels 
# due to a float-to-float error.  A height of 6 pixels is the smallest.
 
 
#==============================================================================
# ** Game_Actor
#------------------------------------------------------------------------------
#  This class handles the actor. It's used within the Game_Actors class
#  ($game_actors) and refers to the Game_Party class ($game_party).
#==============================================================================
 
class Game_Actor < Game_Battler
  #--------------------------------------------------------------------------
  # * Get the current EXP
  #--------------------------------------------------------------------------
  def now_exp
    return @exp - @exp_list[@level]
  end
  #--------------------------------------------------------------------------
  # * Get the next level's EXP
  #--------------------------------------------------------------------------
  def next_exp
    return @exp_list[@level+1] > 0 ? @exp_list[@level+1] - @exp_list[@level] : 0
  end
end
 
 
#==============================================================================
# ** Window_Base 
#------------------------------------------------------------------------------
#  This class is for all in-game windows.
#==============================================================================
 
class Window_Base < Window  
 
  #==========================================================================
  # * Draw Slant Bar(by SephirothSpawn)
  #==========================================================================
  def draw_slant_bar(x, y, min, max, width = 152, height = 6,
      bar_color = Color.new(150, 0, 0, 255),
      end_color = Color.new(255, 255, 60, 255))
    # Draw Border
    for i in 0..height
      self.contents.fill_rect(x + i, y + height - i, width + 1, 1, Color.new(50, 50, 50, 255))
    end
    # Draw Background
    for i in 1..(height - 1)
      r = 100 * (height - i) / height + 0 * i / height
      g = 100 * (height - i) / height + 0 * i / height
      b = 100 * (height - i) / height + 0 * i / height
      a = 255 * (height - i) / height + 255 * i / height
      self.contents.fill_rect(x + i, y + height - i, width, 1, Color.new(r, b, g, a))
    end
    # Draws Bar
    for i in 1..( (min.to_f / max.to_f) * width - 1)
      for j in 1..(height - 1)
        r = bar_color.red * (width - i) / width + end_color.red * i / width
        g = bar_color.green * (width - i) / width + end_color.green * i / width
        b = bar_color.blue * (width - i) / width + end_color.blue * i / width
        a = bar_color.alpha * (width - i) / width + end_color.alpha * i / width
        self.contents.fill_rect(x + i + j, y + height - j, 1, 1, Color.new(r, g, b, a))
      end
    end
  end
 
  #==========================================================================
  # * Draw HP
  #     actor : actor
  #     x     : draw spot x-coordinate
  #     y     : draw spot y-coordinate
  #     width : draw spot width
  #==========================================================================
  alias :draw_actor_hp_hpsp :draw_actor_hp
  def draw_actor_hp(actor, x ,y, width = 144)   
    draw_slant_bar(x , y + 24, actor.hp, actor.maxhp, width, 6, 
      bar_color = Color.new(150, 0, 0, 255), 
      end_color = Color.new(255, 255, 60, 255))
    draw_actor_hp_hpsp(actor, x, y, width)
   end
  #==========================================================================
  # * Draw SP
  #     actor : actor
  #     x     : draw spot x-coordinate
  #     y     : draw spot y-coordinate
  #     width : draw spot width
  #==========================================================================
  alias :draw_actor_sp_hpsp :draw_actor_sp
  def draw_actor_sp(actor, x, y, width = 144)
    draw_slant_bar(x, y + 24, actor.sp, actor.maxsp, width, 6,
      bar_color = Color.new(0, 0, 155, 255), 
      end_color = Color.new(255, 255, 255, 255))
    draw_actor_sp_hpsp(actor, x, y, width)
  end
  #==========================================================================
  # * Draw EXP
  #     actor : actor
  #     x     : draw spot x-coordinate
  #     y     : draw spot y-coordinate
  #==========================================================================
  alias raz_bars_base_exp draw_actor_exp  
  def draw_actor_exp(actor, x, y)
    if actor.level == 99
      draw_slant_bar(x, y + 18, 1, 1, 190, 6, bar_color = Color.new(0, 100, 0, 255), end_color = Color.new(0, 255, 0, 255))
    else
      draw_slant_bar(x, y + 18, actor.now_exp, actor.next_exp, 190, 6, bar_color = Color.new(0, 100, 0, 255), end_color = Color.new(255, 255, 255, 255))
    end
    raz_bars_base_exp(actor, x, y)
  end
  #==========================================================================
  # * Draw Parameter
  #     actor : actor
  #     x     : draw spot x-coordinate
  #     y     : draw spot y-coordinate
  #     type  : parameter type (0-6)
  #==========================================================================
  alias raz_bars_base_parameter draw_actor_parameter  
  def draw_actor_parameter(actor, x, y, type)
    case type
    when 0
      para_color1 = Color.new(100,0,0)
      para_color2 = Color.new(255,0,0)
      para_begin = actor.atk
    when 1
      para_color1 = Color.new(100,100,0)
      para_color2 = Color.new(255,255,0)
      para_begin = actor.pdef
    when 2
      para_color1 = Color.new(100,0,100)
      para_color2 = Color.new(255,0,255)
      para_begin = actor.mdef
    when 3
      para_color1 = Color.new(50,0,100)
      para_color2 = Color.new(50,0,255)
      para_begin = actor.str
    when 4
      para_color1 = Color.new(0,100,0)
      para_color2 = Color.new(0,255,0)
      para_begin = actor.dex
    when 5
      para_color1 = Color.new(50,0,50)
      para_color2 = Color.new(255,0,255)
      para_begin = actor.agi
    when 6
      para_color1 = Color.new(0,100,100)
      para_color2 = Color.new(0,255,255)
      para_begin = actor.int
    end
    draw_slant_bar(x, y + 18, para_begin, 999, 155, 4, bar_color = para_color1,
      end_color = para_color2)
    raz_bars_base_parameter(actor, x, y, type)
  end
  #=========================================================================
  # * Draw Actor ATG
  #     actor : Actor
  #     x     : draw spot x-coordinate
  #     y     : draw spot y-coordinate
  #     width : draw spot width
  #=========================================================================
  def draw_actor_atg(actor, x, y, width = 144, height = 6)
    if @at_gauge == nil
      # plus_x:     revised x-coordinate
      # rate_x:     revised X-coordinate as (%)
      # plus_y:     revised y-coordinate
      # plus_width: revised width
      # rate_width: revised width as (%)
      # height:     Vertical width
      # align1: Type 1 ( 0: left justify  1: center justify 2: right justify )
      # align2: Type 2 ( 0: Upper stuffing 1: Central arranging  2:Lower stuffing )
      # align3: Gauge type 0:Left justify 1: Right justify
      @plus_x = 0
      @rate_x = 0
      @plus_y = 16
      @plus_width = 0
      @rate_width = 100
      @width = @plus_width + width * @rate_width / 100
      @height = 6
      @align1 = 0
      @align2 = 1
      @align3 = 0
      # Gradation settings:  grade1: Empty gauge   grade2:Actual gauge
      # (0:On side gradation   1:Vertically gradation    2: Slantedly gradation)
      grade1 = 1
      grade2 = 0
      # Color setting. color1: Outermost framework, color2: Medium framework
      # color3: Empty framework dark color, color4: Empty framework light/write color
      color1 = Color.new(0, 0, 0)
      color2 = Color.new(255, 255, 192)
      color3 = Color.new(0, 0, 0, 192)
      color4 = Color.new(0, 0, 64, 192)
      # Color setting of gauge
      # Usually color setting of the time
      color5 = Color.new(0, 64, 80)
      color6 = Color.new(255, 255, 255)#(0, 128, 160)
      # When gauge is MAX, color setting
      color7 = Color.new(80, 0, 0)
      color8 = Color.new(255, 255,255) #(240,0,0)
      # Color setting at time of cooperation skill use
      color9 = Color.new(80, 64, 32)
      color10 = Color.new(255, 255, 255) #(240, 192, 96)
      # Color setting at time of skill permanent residence
      color11 = Color.new(80, 0, 64)
      color12 = Color.new(255,255, 255) #(240, 0, 192)
      # Drawing of gauge
      gauge_rect_at(@width, @height, @align3, color1, color2, color3, color4,
          color5, color6, color7, color8, color9, color10, color11, color12,
          grade1, grade2)
    end
    # Variable at substituting the width of the gauge which is drawn
    if actor.rtp == 0
      at = (width + @plus_width) * actor.atp * @rate_width / 10000
    else
      at = (width + @plus_width) * actor.rt * @rate_width / actor.rtp / 100
    end
    # AT Width Check
    if at > width
      at = width
    end
    # Revision such as the left stuffing central posture of gauge
    case @align1
    when 1
      x += (@rect_width - width) / 2
    when 2
      x += @rect_width - width
    end
    case @align2
    when 1
      y -= @height / 2
    when 2
      y -= @height
    end
    # Draw Border
    for i in 0..height
      self.contents.fill_rect(x + 1.5 + i, y + 12 + height - i, width - 2 , 3,
        Color.new(50, 50, 50, 255))
    end
    # Draw Background
    for i in 1..(height - 1)
      r = 100 * (height - i) / height + 0 * i / height
      g = 100 * (height - i) / height + 0 * i / height
      b = 100 * (height - i) / height + 0 * i / height
      a = 255 * (height - i) / height + 255 * i / height
      self.contents.fill_rect(x + 1.5 + i, y + 12 + height - i, width - 3, 3, 
        Color.new(r, b, g, a))
    end
    # Rect_X control
    if @align3 == 0
      rect_x = 0
    else
      x += @width - at - 1
      rect_x = @width - at - 1
    end
 
    # Color setting of gauge
    if at == width 
    #Gauge drawing at the time of MAX
      for i in 0..height
        self.contents.blt(x + i + @plus_x + @width * @rate_x / 100, y -i + 
        @plus_y, @at_gauge, Rect.new(rect_x, @height * 2, at, @height))
      end
    else
      if actor.rtp == 0
        for i in 0..height
          # Usually gauge drawing of the time
          self.contents.blt(x + i + @plus_x + @width * @rate_x / 100, y- i + 
            @plus_y, @at_gauge,Rect.new(rect_x, @height, at, @height))
        end
      else
        if actor.spell == true
          for i in 0..height
            #Gauge drawing at time of cooperation skill use
            self.contents.blt(x + i + @plus_x + @width * @rate_x / 100, y - i + 
              @plus_y, @at_gauge, Rect.new(rect_x, @height * 3, at, @height))
          end
        else
          for i in 0..height              
            # Gauge drawing at time of skill permanent residence
            self.contents.blt(x + i + @plus_x + @width * @rate_x / 100, y - i +
              @plus_y, @at_gauge, Rect.new(rect_x, @height * 4, at, @height))
          end
        end
      end
    end
  end
  #=========================================================================
  # * Draw Actor Limit Break Bar
  #     actor : Actor
  #     x     : draw spot x-coordinate
  #     y     : draw spot y-coordinate
  #     width : draw spot width
  #=========================================================================
  def draw_actor_lb(actor, x, y, width = 144)
    rate = actor.limitbreak.to_f / LB_MAX
    plus_x = 0
    rate_x = 0
    plus_y = 15
    plus_width = 0
    rate_width = 100
    height = 7
    lb = (width + plus_width) * actor.limitbreak * rate_width / 100 / LB_MAX
    # Drawing of gauge
    if actor.limitbreak == LB_MAX
      # Draw Silver Blue Bar
      draw_slant_bar(x + plus_x + width * rate_x / 100, y + plus_y, lb, width,
        width, height, od_color1 = Color.new(0,80,200,192), 
        od_color2 = Color.new(255,255,255,192))
    else
      # Draw Green Bar
      draw_slant_bar(x + plus_x + width * rate_x / 100, y + plus_y, lb, width,
        width, height, od_color1 = Color.new(31, 128, 0, 128), 
        od_color2 = Color.new(255, 255, 191))
    end
  end  
end
Nur noch selten hier.

'Til now, I always let people walk all over me!
From now on, if anyone makes fun of me, I'll kill 'em! Just like that!

  • »MinekTerra« ist der Autor dieses Themas

Motto: Aus Fehlern lernt man

  • Nachricht senden

3

Samstag, 6. November 2010, 16:24

ok, ich glaube du hältst mich etz ürgendwie für nen idiot oder soo^^ aber da kommt nix, wenn ich Insert
und name eingebe. Dann das Script und dann starten.
Bild :yahoo!:
By MinekTerra

Yuber

Seher

Motto: Die Welt zu beherrschen.

  • Nachricht senden

4

Samstag, 6. November 2010, 19:53

Hast du das Script direkt über Main eingefügt?
Wenn du ins Menü gehst sollte ein EXP Balken erscheinen.

(Oder wolltest du das nach einem Kampf ein EXP Bildschirm kommt?)
Nur noch selten hier.

'Til now, I always let people walk all over me!
From now on, if anyone makes fun of me, I'll kill 'em! Just like that!

  • »MinekTerra« ist der Autor dieses Themas

Motto: Aus Fehlern lernt man

  • Nachricht senden

5

Samstag, 6. November 2010, 21:03

Naja in meinem Spiel habe ich ein eigenes Menü gemacht und es gibt auch keinen Kampf in meinem Spiel.
Ich dachte mir sowas, wie unter dem Spiel, also auf der Map wenn man sich bewegt, dass das die ganze Zeit unten eingeblendet wird. :)
Bild :yahoo!:
By MinekTerra

Irrlicht

Leuchtendes Irgendwas

Motto: Keep shining!

  • Nachricht senden

6

Sonntag, 7. November 2010, 11:50

Ich hab die entsprechenden Komponenten aus dem o.g. Script mal in eine On-Map-Anzeige eingefügt:
(Vielen Dank dabei nochmal an Ankou, der mir bei einem scripttechnischen Problem weiterhelfen konnte)

Es ist atm eher zweckdienlich als hübsch, aber evtl. passt es ja so:
Spoiler

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
# Der Inhalt dieses Script wurde zu großen Teilen aus diesem Script übernommen:
 
#===========================================================================
# *** HP/MP/ATB/LimitBreak bar Slanted Style Compatible with RTAB ***
# *** Version 2.1
#---------------------------------------------------------------------------
# by Clive 
# based on Cogwheel's Bars and Sephiroth Spawn's Slanted Bars.
#---------------------------------------------------------------------------
# ----- GREAT THANKS to DerVVulfman for solving the lag problem
#------This is a plug and play script so it should work without any problem!
#=============================================================================
 
##############################################################################
 
class Sprite_OnMapExperience < Sprite
 
  # Grafik aus dem Pictures-Ordner die als Hintergrund verwendet wird:
  # 'Bildname' einfügen um ein solches Bild zu verwenden;
  # '' eingeben um keinen Hintergrund zu verwenden
  # 'Windowskin' eingeben um den aktuellen Windowskin zu verwenden (dabei ist es egal ob
  #  sich dieser Begriff mit einem Bildnamen überschneidet)
  BACKGROUND_PICTURE = 'Windowskin'
 
  # der am Rand des Bildes freigehaltene Platz (beeinflusst die Größe des Windowskin-Hintergrunds)
  BORDER_SIZE = 8
 
  # Transparenz des eingefügten Bildes oder des Hintergrunds des Windowskins
  CUSTOM_BACK_OPACITY = 200
 
end
 
#==============================================================================
# ** Game_Actor
#------------------------------------------------------------------------------
#  This class handles the actor. It's used within the Game_Actors class
#  ($game_actors) and refers to the Game_Party class ($game_party).
#==============================================================================
 
class Game_Actor < Game_Battler
  #--------------------------------------------------------------------------
  # * Get the current EXP
  #--------------------------------------------------------------------------
  def now_exp     #übernommen
    return @exp - @exp_list[@level]
  end
  #--------------------------------------------------------------------------
  # * Get the next level's EXP
  #--------------------------------------------------------------------------
  def next_exp    #übernommen
    return @exp_list[@level+1] > 0 ? @exp_list[@level+1] - @exp_list[@level] : 0
  end
 
  alias_method(:exp_IL_changes_omeb, :exp= ) unless method_defined?(:exp_IL_changes_omeb)
  def exp=(exp)
    exp_IL_changes_omeb(exp)
    if $scene.is_a?(Scene_Map)
      $scene.refresh_exp_bar(self.index)
    end
  end
end
 
 
 
class Game_Player
 
  alias_method(:refresh_IL_changes_omeb, :refresh) unless method_defined?(:refresh_IL_changes_omeb)
  def refresh
    refresh_IL_changes_omeb
    if $scene.is_a?(Scene_Map)
      $scene.refresh_exp_bar
    end
  end
end
 
 
 
class Scene_Map
 
  alias_method(:main_IL_changes_omeb, :main) unless method_defined?(:main_IL_changes_omeb)
  def main
    @exp_bar_sprite = Sprite_OnMapExperience.new
    main_IL_changes_omeb
    @exp_bar_sprite.dispose
  end
 
  def refresh_exp_bar(member_index = -1)
    return if member_index.nil?
    @exp_bar_sprite.refresh(member_index)
  end
 
  def exp_visible=(verity)
    @exp_bar_sprite.visible = verity
  end
end
 
 
 
class Sprite_OnMapExperience < Sprite
 
  def initialize
    super
    width = 204 + BORDER_SIZE * 2
    height = $game_party.actors.size * 32 + BORDER_SIZE * 2
    self.bitmap = Bitmap.new(width, height)
    if BACKGROUND_PICTURE == 'Windowskin'
      @background = make_windowskin_background(width, height)
    else
      @background = RPG::Cache.picture(BACKGROUND_PICTURE)
    end
    self.x = 640 - width
    self.y = 480 - height
    self.z = 60
    refresh
  end
 
  def dispose
    self.bitmap.dispose
    super
  end
 
  def visible=(verity)
    need_refresh = (verity and not self.visible)
    super(verity)
    refresh if need_refresh
  end
 
  def refresh(member_index = -1)
    return unless self.visible
    if member_index == -1
      if height = $game_party.actors.size * 32 + BORDER_SIZE * 2 != self.bitmap.height
        width = self.bitmap.width
        self.bitmap.dispose
        self.bitmap = Bitmap.new(width, height)
        self.y = 480 - height
        if BACKGROUND_PICTURE == 'use custom'
          @background = make_custom_background(width, height)
        end
      else  
        self.bitmap.clear
      end
      self.bitmap.blt(0, 0, @background, self.bitmap.rect)
      $game_party.actors.each_with_index do |actor, index|
        draw_actor_exp(actor, BORDER_SIZE, BORDER_SIZE + index * 32)
      end
    else
      x = BORDER_SIZE
      y = BORDER_SIZE + member_index * 32
      self.bitmap.fill_rect(x, y, 204, 32, Color.new(0, 0, 0, 0))
      self.bitmap.blt(x, y, @background, Rect.new(x, y, 204, 32))
      draw_actor_exp($game_party.actors[member_index], x, y)
    end
  end
 
 
  def draw_actor_exp(actor, x, y)                                #übernommen
    if actor.next_exp == 0 #level == 99                          #geändert
      draw_slant_bar(x, y + 18, 1, 1, 190, 6)
    else
      draw_slant_bar(x, y + 18, actor.now_exp, actor.next_exp, 190, 6)
    end
    self.bitmap.font.color = Color.new(192, 224, 255, 255)
    self.bitmap.draw_text(x, y, 24, 32, "E")
    self.bitmap.font.color = Color.new(255, 255, 255, 255)
    self.bitmap.draw_text(x + 24, y, 84, 32, actor.exp_s, 2)
    self.bitmap.draw_text(x + 108, y, 12, 32, "/", 1)
    self.bitmap.draw_text(x + 120, y, 84, 32, actor.next_exp_s)
  end
 
  #==========================================================================
  # * Draw Slant Bar(by SephirothSpawn)
  #==========================================================================
  def draw_slant_bar(x, y, min, max, width = 152, height = 6,     #übernommen
      bar_color = Color.new(0, 100, 0, 255),
      end_color = Color.new(0, 255, 0, 255))
    # Draw Border
    for i in 0..height
      self.bitmap.fill_rect(x + i, y + height - i, width + 1, 1, Color.new(50, 50, 50, 255))
    end
    # Draw Background
    for i in 1..(height - 1)
      r = 100 * (height - i) / height + 0 * i / height
      g = 100 * (height - i) / height + 0 * i / height
      b = 100 * (height - i) / height + 0 * i / height
      a = 255 * (height - i) / height + 255 * i / height
      self.bitmap.fill_rect(x + i, y + height - i, width, 1, Color.new(r, b, g, a))
    end
    # Draws Bar
    for i in 1..( (min.to_f / max.to_f) * width - 1)
      for j in 1..(height - 1)
        r = bar_color.red * (width - i) / width + end_color.red * i / width
        g = bar_color.green * (width - i) / width + end_color.green * i / width
        b = bar_color.blue * (width - i) / width + end_color.blue * i / width
        a = bar_color.alpha * (width - i) / width + end_color.alpha * i / width
        self.bitmap.fill_rect(x + i + j, y + height - j, 1, 1, Color.new(r, g, b, a))
      end
    end
  end
 
 
  def make_windowskin_background(width, height)
    # aktueller Windowskin wird gesichert, Bild wird initialisiert.
    wskin = RPG::Cache.windowskin($game_system.windowskin_name)
    frame = Bitmap.new(width, height)
    # errechne die Größe der Ecken. (wenn Breite/Höhe kleiner als 32 ist)
    cw = [width - (width / 2), 16].min
    ch = [height - (height / 2), 16].min
    # male Hintergrund
    frame.stretch_blt( Rect.new( 2, 2, width - 4, height - 4),
                       wskin, Rect.new( 0, 0, 128, 128), CUSTOM_BACK_OPACITY)
    # male Ecken
    frame.blt( 0, 0, wskin, Rect.new( 128, 0, cw, ch))
    frame.blt( width - cw, 0, wskin, Rect.new( 192 - cw, 0, cw, ch))    
    frame.blt( 0, height - ch, wskin,  Rect.new( 128, 64 - ch, cw, ch))
    frame.blt( width - cw, height - ch, wskin, Rect.new(192 - cw, 64 - ch, cw, ch))
    # male restliche Ränder
    if width > 32
      frame.stretch_blt( Rect.new( 16, 0, width - 32, 16), wskin,
                         Rect.new( 128 + 16, 0, 32, 16))
      frame.stretch_blt( Rect.new( 16, height - 16, width - 32, 16), 
                         wskin, Rect.new( 128 + 16, 64 - 16, 32, 16))
    end              
    if height > 32
      frame.stretch_blt( Rect.new( 0, 16, 16, height - 32), wskin, 
                         Rect.new( 128, 16, 16, 32))
      frame.stretch_blt( Rect.new( width - 16, 16, 16, height - 32),
                         wskin, Rect.new( 192 - 16, 16, 16, 32))
    end
    # gebe das Windowskin-Bild wieder frei               
    wskin.dispose
    # gebe das gezeichnete Bild zurück
    return frame
  end
end
zum Lesen den Text mit der Maus markieren

Dieser Beitrag wurde bereits 2 mal editiert, zuletzt von »Irrlicht« (7. November 2010, 13:42)


Ähnliche Themen

Social Bookmarks