|
 |
| Forum de FFHistory - Le forum de Final Fantasy History |
 |
| Previous topic :: Next topic |
| Author |
Message |
Ekannott Webmaster

 Offline
Joined: 18 Jan 2006 Posts: 112
Genre:  Localisation: Besaid
|
Posted: 04/05/2006 22:37:39 Post subject: [Script] Menu personnalisé |
|
|
C'est pas un script de moi, j'ai seulement fait des modifications pour le rendre utilisable (il marchait pas, quelques méthodes à enlever et d'autres à rajouter)
Nouveau script au dessus de Main, nommez-le "Barre" :
| Code: | # HP/SP/EXPQ?[W\´¦XN¦vg Ver 1.00
# zz¼³?ET|?[gURL
# http://members.jcom.home.ne.jp/cogwheel/
#==============================================================================
# ?¡ Game_Actor
#------------------------------------------------------------------------------
# ?@AN^?[ðµ¤NXÅ·?B±ÌNXÍ Game_Actors NX ($game_actors)
# ÌàÅ´gp³ê?AGame_Party NX ($game_party) ©çà´Q?ƳêÜ·?B
#==============================================================================
class Game_Actor < Game_Battler
def now_exp
return @exp - @exp_list[@level]
end
def next_exp
return @exp_list[@level+1] > 0 ? @exp_list[@level+1] - @exp_list[@level] : 0
end
end
#==============================================================================
# ?¡ Window_Base
#------------------------------------------------------------------------------
# ?@Q?[¤Ì·×ÄÌEBhEÌX?[p?[NXÅ·?B
#==============================================================================
class Window_Base < Window
#--------------------------------------------------------------------------
# ?½ HP Q?[WÌ`æ
#--------------------------------------------------------------------------
# I¦WiÌHP`æð draw_actor_hp_original ƼOÏ?X
alias :draw_actor_hp_original :draw_actor_hp
def draw_actor_hp(actor, x, y, width = 144)
# Ï?rateÉ ¼»?ÝÌHP/MHPðãü
if actor.maxhp != 0
rate = actor.hp.to_f / actor.maxhp
else
rate = 0
end
# plus_x:X?ÀWÌÊuâ?³ rate_x:X?ÀWÌÊuâ?³(%) plus_y:Y?ÀWÌÊuâ?³
# plus_width:?Ìâ?³ rate_width:?Ìâ?³(%) height:?c?
# align1:`æ^Cv1 0:?¶lß 1:µ¦ 2:Elß
# align2:`æ^Cv2 0:?ãlß 1:µ¦ 2:ºlß
# align3:Q?[W^Cv 0:?¶lß 1:Elß
plus_x = 0
rate_x = 0
plus_y = 25
plus_width = 0
rate_width = 100
height = 10
align1 = 1
align2 = 2
align3 = 0
# Of?[V?Ýè grade1:óQ?[W grade2:´ÀQ?[W
# (0:¡ÉOf?[V 1:?cÉOf?[V 2:´ÎßÉOf?[V(¼?d)?j
grade1 = 1
grade2 = 0
# ?F?Ýè?Bcolor1:¦Og?Ccolor2:g
# color3:óQ?[W_?[NJ?[?Ccolor4:óQ?[WCgJ?[
# color5:´ÀQ?[W_?[NJ?[?Ccolor6:´ÀQ?[WCgJ?[
color1 = Color.new(0, 0, 0, 192)
color2 = Color.new(255, 255, 192, 192)
color3 = Color.new(0, 0, 0, 192)
color4 = Color.new(64, 0, 0, 192)
color5 = Color.new(80 - 24 * rate, 80 * rate, 14 * rate, 192)
color6 = Color.new(240 - 72 * rate, 240 * rate, 62 * rate, 192)
# Ï?spÉ`æ·éQ?[WÌ?ðãü
if actor.maxhp != 0
hp = (width + plus_width) * actor.hp * rate_width / 100 / actor.maxhp
else
hp = 0
end
# Q?[WÌ`æ
gauge_rect(x + plus_x + width * rate_x / 100, y + plus_y,
width, plus_width + width * rate_width / 100,
height, hp, align1, align2, align3,
color1, color2, color3, color4, color5, color6, grade1, grade2)
# I¦WiÌHP`æ??ð¼ÄÑ?oµ
draw_actor_hp_original(actor, x, y, width)
end
#--------------------------------------------------------------------------
# ?½ SP Q?[WÌ`æ
#--------------------------------------------------------------------------
# I¦WiÌSP`æð draw_actor_sp_original ƼOÏ?X
alias :draw_actor_sp_original :draw_actor_sp
def draw_actor_sp(actor, x, y, width = 144)
# Ï?rateÉ ¼»?ÝÌSP/MSPðãü
if actor.maxsp != 0
rate = actor.sp.to_f / actor.maxsp
else
rate = 1
end
# plus_x:X?ÀWÌÊuâ?³ rate_x:X?ÀWÌÊuâ?³(%) plus_y:Y?ÀWÌÊuâ?³
# plus_width:?Ìâ?³ rate_width:?Ìâ?³(%) height:?c?
# align1:`æ^Cv1 0:?¶lß 1:µ¦ 2:Elß
# align2:`æ^Cv2 0:?ãlß 1:µ¦ 2:ºlß
# align3:Q?[W^Cv 0:?¶lß 1:Elß
plus_x = 0
rate_x = 0
plus_y = 25
plus_width = 0
rate_width = 100
height = 10
align1 = 1
align2 = 2
align3 = 0
# Of?[V?Ýè grade1:óQ?[W grade2:´ÀQ?[W
# (0:¡ÉOf?[V 1:?cÉOf?[V 2:´ÎßÉOf?[V(¼?d)?j
grade1 = 1
grade2 = 0
# ?F?Ýè?Bcolor1:¦Og?Ccolor2:g
# color3:óQ?[W_?[NJ?[?Ccolor4:óQ?[WCgJ?[
# color5:´ÀQ?[W_?[NJ?[?Ccolor6:´ÀQ?[WCgJ?[
color1 = Color.new(0, 0, 0, 192)
color2 = Color.new(255, 255, 192, 192)
color3 = Color.new(0, 0, 0, 192)
color4 = Color.new(0, 64, 0, 192)
color5 = Color.new(14 * rate, 80 - 24 * rate, 80 * rate, 192)
color6 = Color.new(62 * rate, 240 - 72 * rate, 240 * rate, 192)
# Ï?spÉ`æ·éQ?[WÌ?ðãü
if actor.maxsp != 0
sp = (width + plus_width) * actor.sp * rate_width / 100 / actor.maxsp
else
sp = (width + plus_width) * rate_width / 100
end
# Q?[WÌ`æ
gauge_rect(x + plus_x + width * rate_x / 100, y + plus_y,
width, plus_width + width * rate_width / 100,
height, sp, align1, align2, align3,
color1, color2, color3, color4, color5, color6, grade1, grade2)
# I¦WiÌSP`æ??ð¼ÄÑ?oµ
draw_actor_sp_original(actor, x, y, width)
end
#--------------------------------------------------------------------------
# ?½ EXP Q?[WÌ`æ
#--------------------------------------------------------------------------
# I¦WiÌEXP`æð draw_actor_sp_original ƼOÏ?X
alias :draw_actor_exp_original :draw_actor_exp
def draw_actor_exp(actor, x, y, width = 204)
# Ï?rateÉ ¼»?ÝÌexp/nextexpðãü
if actor.next_exp != 0
rate = actor.now_exp.to_f / actor.next_exp
else
rate = 1
end
# plus_x:X?ÀWÌÊuâ?³ rate_x:X?ÀWÌÊuâ?³(%) plus_y:Y?ÀWÌÊuâ?³
# plus_width:?Ìâ?³ rate_width:?Ìâ?³(%) height:?c?
# align1:`æ^Cv1 0:?¶lß 1:µ¦ 2:Elß
# align2:`æ^Cv2 0:?ãlß 1:µ¦ 2:ºlß
# align3:Q?[W^Cv 0:?¶lß 1:Elß
plus_x = 0
rate_x = 0
plus_y = 25
plus_width = 0
rate_width = 100
height = 10
align1 = 1
align2 = 2
align3 = 0
# Of?[V?Ýè grade1:óQ?[W grade2:´ÀQ?[W
# (0:¡ÉOf?[V 1:?cÉOf?[V 2:´ÎßÉOf?[V(¼?d)?j
grade1 = 1
grade2 = 0
# ?F?Ýè?Bcolor1:¦Og?Ccolor2:g
# color3:óQ?[W_?[NJ?[?Ccolor4:óQ?[WCgJ?[
# color5:´ÀQ?[W_?[NJ?[?Ccolor6:´ÀQ?[WCgJ?[
color1 = Color.new(0, 0, 0, 192)
color2 = Color.new(255, 255, 192, 192)
color3 = Color.new(0, 0, 0, 192)
color4 = Color.new(64, 0, 0, 192)
color5 = Color.new(80 * rate, 80 - 80 * rate ** 2, 80 - 80 * rate, 192)
color6 = Color.new(240 * rate, 240 - 240 * rate ** 2, 240 - 240 * rate, 192)
# Ï?expÉ`æ·éQ?[WÌ?ðãü
if actor.next_exp != 0
exp = (width + plus_width) * actor.now_exp * rate_width /
100 / actor.next_exp
else
exp = (width + plus_width) * rate_width / 100
end
# Q?[WÌ`æ
gauge_rect(x + plus_x + width * rate_x / 100, y + plus_y,
width, plus_width + width * rate_width / 100,
height, exp, align1, align2, align3,
color1, color2, color3, color4, color5, color6, grade1, grade2)
# I¦WiÌEXP`æ??ð¼ÄÑ?oµ
draw_actor_exp_original(actor, x, y)
end
#--------------------------------------------------------------------------
# ?½ Q?[WÌ`æ
#--------------------------------------------------------------------------
def gauge_rect(x, y, rect_width, width, height, gauge, align1, align2, align3,
color1, color2, color3, color4, color5, color6, grade1, grade2)
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
# g`æ
self.contents.fill_rect(x, y, width, height, color1)
self.contents.fill_rect(x + 1, y + 1, width - 2, height - 2, color2)
if align3 == 0
if grade1 == 2
grade1 = 3
end
if grade2 == 2
grade2 = 3
end
end
if (align3 == 1 and grade1 == 0) or grade1 > 0
color = color3
color3 = color4
color4 = color
end
if (align3 == 1 and grade2 == 0) or grade2 > 0
color = color5
color5 = color6
color6 = color
end
# óQ?[WÌ`æ
self.contents.gradation_rect(x + 2, y + 2, width - 4, height - 4,
color3, color4, grade1)
if align3 == 1
x += width - gauge
end
# ´ÀQ?[WÌ`æ
self.contents.gradation_rect(x + 2, y + 2, gauge - 4, height - 4,
color5, color6, grade2)
end
end
#------------------------------------------------------------------------------
# ?@BitmapNXÉ?V½È@\ðÇÁµÜ·?B
#==============================================================================
class Bitmap
#--------------------------------------------------------------------------
# ?½ é¼`ðOf?[V\´¦
# color1 : X^?[gJ?[
# color2 : GhJ?[
# align : 0:¡ÉOf?[V
# 1:?cÉOf?[V
# 2:´ÎßÉOf?[V?i¼?dÉ«?Ó?j
#--------------------------------------------------------------------------
def gradation_rect(x, y, width, height, color1, color2, align = 0)
if align == 0
for i in x...x + width
red = color1.red + (color2.red - color1.red) * (i - x) / (width - 1)
green = color1.green +
(color2.green - color1.green) * (i - x) / (width - 1)
blue = color1.blue +
(color2.blue - color1.blue) * (i - x) / (width - 1)
alpha = color1.alpha +
(color2.alpha - color1.alpha) * (i - x) / (width - 1)
color = Color.new(red, green, blue, alpha)
fill_rect(i, y, 1, height, color)
end
elsif align == 1
for i in y...y + height
red = color1.red +
(color2.red - color1.red) * (i - y) / (height - 1)
green = color1.green +
(color2.green - color1.green) * (i - y) / (height - 1)
blue = color1.blue +
(color2.blue - color1.blue) * (i - y) / (height - 1)
alpha = color1.alpha +
(color2.alpha - color1.alpha) * (i - y) / (height - 1)
color = Color.new(red, green, blue, alpha)
fill_rect(x, i, width, 1, color)
end
elsif align == 2
for i in x...x + width
for j in y...y + height
red = color1.red + (color2.red - color1.red) *
((i - x) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
green = color1.green + (color2.green - color1.green) *
((i - x) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
blue = color1.blue + (color2.blue - color1.blue) *
((i - x) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
alpha = color1.alpha + (color2.alpha - color1.alpha) *
((i - x) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
color = Color.new(red, green, blue, alpha)
set_pixel(i, j, color)
end
end
elsif align == 3
for i in x...x + width
for j in y...y + height
red = color1.red + (color2.red - color1.red) *
((x + width - i) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
green = color1.green + (color2.green - color1.green) *
((x + width - i) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
blue = color1.blue + (color2.blue - color1.blue) *
((x + width - i) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
alpha = color1.alpha + (color2.alpha - color1.alpha) *
((x + width - i) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
color = Color.new(red, green, blue, alpha)
set_pixel(i, j, color)
end
end
end
end
end |
Remplacez Window_MenuStatus par :
| Code: | #==============================================================================
# ¦ Window_MenuStatus
#------------------------------------------------------------------------------
# Menu spécial de Silversun
#==============================================================================
class Window_MenuStatus < Window_Selectable
#--------------------------------------------------------------------------
# ? ?????????
#--------------------------------------------------------------------------
def initialize
super(0, 0, 480, 480)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
refresh
self.active = false
self.index = -1
end
#--------------------------------------------------------------------------
# ? ??????
#--------------------------------------------------------------------------
def refresh
self.contents.clear
@item_max = $game_party.actors.size
for i in 0...$game_party.actors.size
y = 270
x = 220
actor = $game_party.actors[i]
actor1 = $game_party.actors[0]
actor2 = $game_party.actors[1]
actor3 = $game_party.actors[2]
actor4 = $game_party.actors[3]
self.contents.draw_facesquare(actor.character_name, actor.character_hue,10+32*i, 5 )
if @item_max >= 4
#variables
cnw = contents.text_size(actor4.name).width
cnh = contents.text_size(actor4.name).height
ccw = contents.text_size(actor4.class_name).width
cch = contents.text_size(actor4.class_name).height
chpw = contents.text_size(actor4.hp.to_s).width
cspw = contents.text_size(actor4.sp.to_s).width
#draw
draw_actor_battler(actor4,x, y-100)
draw_actor_name(actor4, x-cnw/2, y-275)
draw_actor_class(actor4, x-ccw/2, y-275+cnh)
draw_actor_level(actor4, x-130, y - 275+cnh+cch/2)
draw_actor_state(actor4, x +80, y - 275+cnh+cch/2)
draw_actor_hp(actor4, x-chpw*2, y - 275+cnh*2)
draw_actor_sp(actor4, x -cspw*2, y - 275+cnh*3)
end
if @item_max >= 3
#variables
cnw = contents.text_size(actor3.name).width
cnh = contents.text_size(actor3.name).height
ccw = contents.text_size(actor3.class_name).width
cch = contents.text_size(actor3.class_name).height
clw = contents.text_size(actor3.level.to_s).width
chpw = contents.text_size(actor3.hp.to_s).width
cspw = contents.text_size(actor3.sp.to_s).width
#draw
draw_actor_battler(actor3, x+70, y - 70)
draw_actor_name(actor3, x+180-cnw/2+10, y-140)
draw_actor_class(actor3, x+180-cch/2-35, y-140+cnh)
draw_actor_level(actor3, x+180-clw, y -140+cnh+cch)
draw_actor_state(actor3, x+180-35, y -140+cnh*3)
draw_actor_hp(actor3, x+180-100, y-140+cnh*4)
draw_actor_sp(actor3, x+180-100, y-140+cnh*5)
end
if @item_max >= 2
#variables
cnw = contents.text_size(actor2.name).width
cnh = contents.text_size(actor2.name).height
ccw = contents.text_size(actor2.class_name).width
cch = contents.text_size(actor2.class_name).height
#draw
draw_actor_battler(actor2, x-70,y-70)
draw_actor_name(actor2, x-220, y-140)
draw_actor_class(actor2, x-220, y-140+cnh)
draw_actor_level(actor2, x-220, y -140+cnh+cch)
draw_actor_state(actor2, x-220, y -140+cnh*3)
draw_actor_hp(actor2, x-220, y-140+cnh*4)
draw_actor_sp(actor2, x-220, y-140+cnh*5)
end
if @item_max >= 1
#variables
cnw = contents.text_size(actor1.name).width
cnh = contents.text_size(actor1.name).height
ccw = contents.text_size(actor1.class_name).width
cch = contents.text_size(actor1.class_name).height
chpw = contents.text_size(actor1.hp.to_s).width
cspw = contents.text_size(actor1.sp.to_s).width
#draw
draw_actor_battler(actor1, x,y)
draw_actor_name(actor1, x-cnw/2, y+80)
draw_actor_class(actor1, x-ccw/2, y+80+cnh)
draw_actor_level(actor1, x-130, y + 80+cnh+cch/2)
draw_actor_state(actor1, x +80, y + 80+cnh+cch/2)
draw_actor_hp(actor1, x-chpw*2, y + 80+cnh*2)
draw_actor_sp(actor1, x -cspw*2, y + 80+cnh*3)
end
end
end
#--------------------------------------------------------------------------
# ? ?????????
#--------------------------------------------------------------------------
def update_cursor_rect
if @index < 0
self.cursor_rect.empty
else
self.cursor_rect.set(7+@index*32, 2, 31, 31)
end
end
end |
Remplacez Scene_Menu par :
| Code: | #==============================================================================
# ¦ Scene_Menu
#------------------------------------------------------------------------------
# ??????????????????
#==============================================================================
class Scene_Menu
#--------------------------------------------------------------------------
# ? ?????????
# menu_index : ?????????????
#--------------------------------------------------------------------------
def initialize(menu_index = 0)
@menu_index = menu_index
end
#--------------------------------------------------------------------------
# ? ?????
#--------------------------------------------------------------------------
def main
# ????????????
s1 = $data_system.words.item
s2 = $data_system.words.skill
s3 = $data_system.words.equip
s4 = "État"
s5 = "Sauvegarder"
s6 = "Quitter"
@command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6])
@command_window.index = @menu_index
# ??????? 0 ????
if $game_party.actors.size == 0
# ?????????????????????
@command_window.disable_item(0)
@command_window.disable_item(1)
@command_window.disable_item(2)
@command_window.disable_item(3)
end
# ????????
if $game_system.save_disabled
# ?????????
@command_window.disable_item(4)
end
# ?????????????
@playtime_window = Window_PlayTime.new
@playtime_window.x = 0
@playtime_window.y = 224
# ??????????
@steps_window = Window_Steps.new
@steps_window.x = 0
@steps_window.y = 320
# ????????????
@gold_window = Window_Gold.new
@gold_window.x = 0
@gold_window.y = 416
# ?????????????
@status_window = Window_MenuStatus.new
@status_window.x = 160
@status_window.y = 0
# ?????????
Graphics.transition
# ??????
loop do
# ????????
Graphics.update
# ???????
Input.update
# ??????
update
# ????????????????
if $scene != self
break
end
end
# ?????????
Graphics.freeze
# ????????
@command_window.dispose
@playtime_window.dispose
@steps_window.dispose
@gold_window.dispose
@status_window.dispose
end
#--------------------------------------------------------------------------
# ? ??????
#--------------------------------------------------------------------------
def update
# ????????
@command_window.update
@playtime_window.update
@steps_window.update
@gold_window.update
@status_window.update
# ??????????????????: update_command ???
if @command_window.active
update_command
return
end
# ???????????????????: update_status ???
if @status_window.active
update_status
return
end
end
#--------------------------------------------------------------------------
# ? ?????? (??????????????????)
#--------------------------------------------------------------------------
def update_command
# B ??????????
if Input.trigger?(Input::B)
# ????? SE ???
$game_system.se_play($data_system.cancel_se)
# ??????????
$scene = Scene_Map.new
return
end
# C ??????????
if Input.trigger?(Input::C)
# ??????? 0 ??????????????????????
if $game_party.actors.size == 0 and @command_window.index < 4
# ??? SE ???
$game_system.se_play($data_system.buzzer_se)
return
end
# ???????????????????
case @command_window.index
when 0 # ????
# ?? SE ???
$game_system.se_play($data_system.decision_se)
# ???????????
$scene = Scene_Item.new
when 1 # ???
# ?? SE ???
$game_system.se_play($data_system.decision_se)
# ???????????????????
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 2 # ??
# ?? SE ???
$game_system.se_play($data_system.decision_se)
# ???????????????????
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 3 # ?????
# ?? SE ???
$game_system.se_play($data_system.decision_se)
# ???????????????????
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 4 # ???
# ????????
if $game_system.save_disabled
# ??? SE ???
$game_system.se_play($data_system.buzzer_se)
return
end
# ?? SE ???
$game_system.se_play($data_system.decision_se)
# ??????????
$scene = Scene_Save.new
when 5 # ?????
# ?? SE ???
$game_system.se_play($data_system.decision_se)
# ????????????
$scene = Scene_End.new
end
return
end
end
#--------------------------------------------------------------------------
# ? ?????? (???????????????????)
#--------------------------------------------------------------------------
def update_status
# B ??????????
if Input.trigger?(Input::B)
# ????? SE ???
$game_system.se_play($data_system.cancel_se)
# ??????????????????
@command_window.active = true
@status_window.active = false
@status_window.index = -1
return
end
# C ??????????
if Input.trigger?(Input::C)
# ???????????????????
case @command_window.index
when 1 # ???
# ???????????? 2 ?????
if $game_party.actors[@status_window.index].restriction >= 2
# ??? SE ???
$game_system.se_play($data_system.buzzer_se)
return
end
# ?? SE ???
$game_system.se_play($data_system.decision_se)
# ??????????
$scene = Scene_Skill.new(@status_window.index)
when 2 # ??
# ?? SE ???
$game_system.se_play($data_system.decision_se)
# ?????????
$scene = Scene_Equip.new(@status_window.index)
when 3 # ?????
# ?? SE ???
$game_system.se_play($data_system.decision_se)
# ????????????
$scene = Scene_Status.new(@status_window.index)
end
return
end
end
end
#---------------------------------
#Par Krazplay
#---------------------------------
def draw_actor_battler(actor, x, y)
bitmap = RPG::Cache.battler(actor.battler_name, actor.battler_hue)
cw = bitmap.width
ch = bitmap.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x - cw / 2, y - ch / 2, bitmap, src_rect)
end
#---------------------------------
#Def draw line
#---------------------------------
def draw_line(start_x, start_y, end_x, end_y, start_color, width = 1, end_color = start_color)
# ???????????????????
distance = (start_x - end_x).abs + (start_y - end_y).abs
# ????
if end_color == start_color
for i in 1..distance
x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i
y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i
if width == 1
self.set_pixel(x, y, start_color)
else
self.fill_rect(x, y, width, width, start_color)
end
end
else
for i in 1..distance
x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i
y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i
r = start_color.red * (distance-i)/distance + end_color.red * i/distance
g = start_color.green * (distance-i)/distance + end_color.green * i/distance
b = start_color.blue * (distance-i)/distance + end_color.blue * i/distance
a = start_color.alpha * (distance-i)/distance + end_color.alpha * i/distance
if width == 1
self.set_pixel(x, y, Color.new(r, g, b, a))
else
self.fill_rect(x, y, width, width, Color.new(r, g, b, a))
end
end
end
end
#---------------------------------
#Def draw polygon (pour faire les contours des faces)
#---------------------------------
def draw_polygon(peaks, color, width = 1)
# ?(=??)??????????
for i in 0 ... (peaks.size - 1)
# ?????????
draw_line( peaks[i][0], peaks[i][1], peaks[i+1][0], peaks[i+1][1], color, width )
end
# ??????????????
draw_line( peaks[peaks.size - 1][0], peaks[peaks.size - 1][1], peaks[0][0], peaks[0][1], color, width )
end
#---------------------------------
#def draw face (les faces à proprement parler ^^)
#---------------------------------
def draw_facesquare(character_name, character_hue, x, y, size = 24)
bitmap = RPG::Cache.character(character_name, character_hue)
src_rect = Rect.new((bitmap.width/4 - size)/2, 0, size, size)
self.blt(x, y, bitmap, src_rect)
self.draw_polygon([[x,y],[x+size,y],[x+size,y+size],[x,y+size]], Color.new(255,255,255,128))
end
#---------------------------------
#Par Krazplay
#---------------------------------
def draw_actor_battler(actor, x, y)
bitmap = RPG::Cache.battler(actor.battler_name, actor.battler_hue)
cw = bitmap.width
ch = bitmap.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x - cw / 2, y - ch / 2, bitmap, src_rect)
end
#---------------------------------
#Def draw line
#---------------------------------
def draw_line(start_x, start_y, end_x, end_y, start_color, width = 1, end_color = start_color)
# ???????????????????
distance = (start_x - end_x).abs + (start_y - end_y).abs
# ????
if end_color == start_color
for i in 1..distance
x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i
y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i
if width == 1
self.set_pixel(x, y, start_color)
else
self.fill_rect(x, y, width, width, start_color)
end
end
else
for i in 1..distance
x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i
y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i
r = start_color.red * (distance-i)/distance + end_color.red * i/distance
g = start_color.green * (distance-i)/distance + end_color.green * i/distance
b = start_color.blue * (distance-i)/distance + end_color.blue * i/distance
a = start_color.alpha * (distance-i)/distance + end_color.alpha * i/distance
if width == 1
self.set_pixel(x, y, Color.new(r, g, b, a))
else
self.fill_rect(x, y, width, width, Color.new(r, g, b, a))
end
end
end
end
#---------------------------------
#Def draw polygon (pour faire les contours des faces)
#---------------------------------
def draw_polygon(peaks, color, width = 1)
# ?(=??)??????????
for i in 0 ... (peaks.size - 1)
# ?????????
draw_line( peaks[i][0], peaks[i][1], peaks[i+1][0], peaks[i+1][1], color, width )
end
# ??????????????
draw_line( peaks[peaks.size - 1][0], peaks[peaks.size - 1][1], peaks[0][0], peaks[0][1], color, width )
end
#---------------------------------
#def draw face (les faces à proprement parler ^^)
#---------------------------------
def draw_facesquare(character_name, character_hue, x, y, size = 24)
bitmap = RPG::Cache.character(character_name, character_hue)
src_rect = Rect.new((bitmap.width/4 - size)/2, 0, size, size)
self.blt(x, y, bitmap, src_rect)
self.draw_polygon([[x,y],[x+size,y],[x+size,y+size],[x,y+size]], Color.new(255,255,255,128))
end |
|
|
| Back to top |
|
lm tigresse Newbie

 Offline
Joined: 17 Jun 2006 Posts: 12
Genre: 
|
Posted: 17/06/2006 16:07:57 Post subject: [Script] Menu personnalisé |
|
|
J'adore le screen , donc ca a beaucouo avancer par contre c'est quoii c'est prenom ???  |
|
| Back to top |
|
Ekannott Webmaster

 Offline
Joined: 18 Jan 2006 Posts: 112
Genre:  Localisation: Besaid
|
Posted: 17/06/2006 21:54:43 Post subject: [Script] Menu personnalisé |
|
|
C'est un script Rpg Maker, donc les prénoms, les battlers et le windowskin sont d'origine xD
C'est pas moi qui choisirai des noms comme ça, j'te jure xD |
|
| Back to top |
|
lm tigresse Newbie

 Offline
Joined: 17 Jun 2006 Posts: 12
Genre: 
|
Posted: 25/06/2006 23:04:41 Post subject: [Script] Menu personnalisé |
|
|
Bah ta pas de blo tu te retrouve avec des prenoms comme Hilda .
MAIS OU VAS LE MONDE.  |
|
| Back to top |
|
Ekannott Webmaster

 Offline
Joined: 18 Jan 2006 Posts: 112
Genre:  Localisation: Besaid
|
Posted: 25/06/2006 23:25:01 Post subject: [Script] Menu personnalisé |
|
|
ptdr Lori ^^
T'as pas tout compris, moi j'm'en bat les reins d'ce prénom xD
C'est pas pour mon jeu ou quoique ce soit, c'est le nom de base de Rpg Maker d'un des personnages. Personne ne va faire un jeu en laissant ce prénom, sauf s'il est complètement con ^^ |
|
| Back to top |
|
lm tigresse Newbie

 Offline
Joined: 17 Jun 2006 Posts: 12
Genre: 
|
Posted: 25/06/2006 23:38:05 Post subject: [Script] Menu personnalisé |
|
|
Bah ca peut arrive .  |
|
| Back to top |
|
Ekannott Webmaster

 Offline
Joined: 18 Jan 2006 Posts: 112
Genre:  Localisation: Besaid
|
Posted: 26/06/2006 00:18:05 Post subject: [Script] Menu personnalisé |
|
|
| C'est sur, y'en a tellement des gens cons ^^ |
|
| Back to top |
|
|
|
 |
 |
Powered by phpBB © 2001, 2008 phpBB Group
iCGstation v1.0 Template By Ray © 2003, 2004 iOptional
|
 |
|
|