赞 | 0 |
VIP | 0 |
好人卡 | 0 |
积分 | 1 |
经验 | 7638 |
最后登录 | 2017-6-13 |
在线时间 | 384 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 384 小时
- 注册时间
- 2008-1-12
- 帖子
- 114
|
4楼
楼主 |
发表于 2009-2-18 02:38:52
|
只看该作者
FF12的脚本吗?劳烦看一下{/gg}脚本很长……{/gg}我分贴贴了……
#=========================================================
# This is the ffx-2 Custom Menu System by Catchm.
# It is a long script and includes many alterations and images attached to it.
# These images can be edited, and the script can be edited, you are free to do so
# credit to Catchm is the only thing needed.
# this is to be copied into a new script in the script editor
#
# Have fun with the script!
#=========================================================
class Bitmap
def draw_text_shadow_rect(rect, text, align = 0)
self.font.size -= 2
old_col = self.font.color.clone
# Dark shadow
self.font.color = Color.new(0,0,0, 255)
draw_text(Rect.new(rect.x+1, rect.y+1, rect.width,
rect.height), text, align)
# Small outline
self.font.color = Color.new(96,96,96,96)
draw_text(Rect.new(rect.x+1, rect.y, rect.width,
rect.height), text, align)
draw_text(Rect.new(rect.x-1, rect.y, rect.width,
rect.height), text, align)
draw_text(Rect.new(rect.x, rect.y-1, rect.width,
rect.height), text, align)
draw_text(Rect.new(rect.x, rect.y+1, rect.width,
rect.height), text, align)
# Normal text
self.font.color = old_col
draw_text(rect, text, align)
self.font.size += 2
end
def draw_text_shadow(x, y, wid, hei, text, align = 0)
self.font.size -= 2
old_col = self.font.color.clone
# Dark shadow
self.font.color = Color.new(0,0,0, 255)
draw_text(x+1,y+1,wid,hei,text, align)
# Small outline
self.font.color = Color.new(96,96,96,96)
draw_text(x+1,y,wid,hei,text, align)
draw_text(x+2,y,wid,hei,text, align)
draw_text(x+2,y,wid,hei,text, align)
draw_text(x,y-1,wid,hei,text, align)
draw_text(x,y+1,wid,hei,text, align)
draw_text(x,y+2,wid,hei,text, align)
# Normal
self.font.color = old_col
draw_text(x,y,wid,hei,text, align)
self.font.size += 2
end
def draw_text_outline(x, y, wid, hei, text, align = 0)
self.font.color = Color.new(0, 0, 0, 255)
draw_text(x + 1,y + 1,wid,hei,text, align)
draw_text(x + 1,y - 1,wid,hei,text, align)
draw_text(x - 1,y - 1,wid,hei,text, align)
draw_text(x - 1,y + 1,wid,hei,text, align)
self.font.color = Color.new(255, 255, 255, 255)
draw_text(x,y,wid,hei,text, align)
end
def draw_text_outline2(x, y, wid, hei, text, align = 0)
self.font.color = Color.new(0, 0, 0, 255)
draw_text(x + 1,y + 1,wid,hei,text, align)
draw_text(x + 1,y - 1,wid,hei,text, align)
draw_text(x - 1,y - 1,wid,hei,text, align)
draw_text(x - 1,y + 1,wid,hei,text, align)
self.font.color = Color.new(255, 255, 255, 200)
draw_text(x,y,wid,hei,text, align)
end
def draw_text_outline3(x, y, wid, hei, text, align = 0)
self.font.color = Color.new(0, 0, 0, 255)
draw_text(x + 1,y + 1,wid,hei,text, align)
draw_text(x + 1,y - 1,wid,hei,text, align)
draw_text(x - 1,y - 1,wid,hei,text, align)
draw_text(x - 1,y + 1,wid,hei,text, align)
self.font.color = Color.new(192, 224, 255, 255)
draw_text(x,y,wid,hei,text, align)
end
def draw_text_outline4(x, y, wid, hei, text, align = 0)
self.font.color = Color.new(0, 0, 0, 190)
draw_text(x + 1,y + 1,wid,hei,text, align)
draw_text(x + 1,y - 1,wid,hei,text, align)
draw_text(x - 1,y - 1,wid,hei,text, align)
draw_text(x - 1,y + 1,wid,hei,text, align)
self.font.color = Color.new(255, 255, 255, 255)
draw_text(x,y,wid,hei,text, align)
end
end
class Window_Base < Window
#=====================================
# Gradient Bars , thanks to Acedent Prone
def draw_normal_barz(x, y, type, length, thick, e1, e2, c1 = Color.new(255,0,0,255), c2 = Color.new(0,0,0,255))
if type == "horizontal"
width = length
height = thick
self.contents.fill_rect(x-1, y - 1, width+2, height + 3, Color.new(255, 255, 255, 255))
self.contents.fill_rect(x, y, width, height + 1, Color.new(0, 0, 0, 255))
w = width * e1 / e2
for i in 0..height
r = c1.red + (c2.red - c1.red) * (height -i)/height + 0 * i/height
g = c1.green + (c2.green - c1.green) * (height -i)/height + 0 * i/height
b = c1.blue + (c2.blue - c1.blue) * (height -i)/height + 0 * i/height
a = c1.alpha + (c2.alpha - c1.alpha)* (height -i)/height + 255 * i/height
self.contents.fill_rect(x, y+i, w, 1, Color.new(r, g, b, a))
end
elsif type == "vertical"
width = thick
height = length
self.contents.fill_rect(x-1, y - 1, width+3, height + 2, Color.new(255, 255, 255, 255))
self.contents.fill_rect(x, y, width+1, height , Color.new(0, 0, 0, 255))
h = height * e1 / e2
for i in 0..width
r = c1.red + (c2.red - c1.red) * (width -i)/width + 0 * i/width
g = c1.green + (c2.green - c1.green) * (width -i)/width + 0 * i/width
b = c1.blue + (c2.blue - c1.blue) * (width -i)/width + 0 * i/width
a = c1.alpha + (c2.alpha - c1.alpha)* (width -i)/width + 255 * i/width
self.contents.fill_rect(x+i, y, 1, h, Color.new(r, g, b, a))
end
end
end
def draw_actor_barz(actor,x, y, type, length, thick, e1, e2, c1 = Color.new(255,0,0,255), c2 = Color.new(0,0,0,255))
if type == "horizontal"
width = length
height = thick
self.contents.fill_rect(x-1, y - 1, width+2, height + 3, Color.new(0, 0, 0, 255))
self.contents.fill_rect(x, y, width, height + 1, Color.new(0, 0, 0, 255))
w = width * e1 / e2
for i in 0..height
r = c1.red + (c2.red - c1.red) * (height -i)/height + 0 * i/height
g = c1.green + (c2.green - c1.green) * (height -i)/height + 0 * i/height
b = c1.blue + (c2.blue - c1.blue) * (height -i)/height + 0 * i/height
a = c1.alpha + (c2.alpha - c1.alpha)* (height -i)/height + 255 * i/height
self.contents.fill_rect(x, y+i, w, 1, Color.new(r, g, b, a))
end
elsif type == "vertical"
width = thick
height = length
self.contents.fill_rect(x-1, y - 1, width+3, height + 2, Color.new(255, 255, 255, 255))
self.contents.fill_rect(x, y, width+1, height , Color.new(0, 0, 0, 255))
h = height * e1 / e2
for i in 0..width
r = c1.red + (c2.red - c1.red) * (width -i)/width + 0 * i/width
g = c1.green + (c2.green - c1.green) * (width -i)/width + 0 * i/width
b = c1.blue + (c2.blue - c1.blue) * (width -i)/width + 0 * i/width
a = c1.alpha + (c2.alpha - c1.alpha)* (width -i)/width + 255 * i/width
self.contents.fill_rect(x+i, y, 1, h, Color.new(r, g, b, a))
end
end
end
#=====================================
# New definitions
def draw_battlegraphic(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, bitmap, src_rect)
end
#======================================
def draw_actor_statuswindow(actor, x, y)
bitmap = RPG::Cache.picture(actor.character_name, actor.character_hue)
cw = bitmap.width / 4
ch = bitmap.height / 4
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect)
end
#=====================================
def draw_actor_face(actor, x, y)
face = RPG::Cache.character("Faces/" + actor.character_name, actor.character_hue)
fw = face.width
fh = face.height
src_rect = Rect.new(0, 0, fw, fh)
self.contents.blt(x - fw / 23, y - fh, face, src_rect)
end
#=====================================
def draw_actor_name2(actor, x, y)
self.contents.font.name = $fontface
self.contents.font.color = outline_color
self.contents.draw_text(x - 1, y - 1, 120, 32, actor.name)
self.contents.draw_text(x + 1, y - 1, 120, 32, actor.name)
self.contents.draw_text(x + 1, y + 1, 120, 32, actor.name)
self.contents.draw_text(x - 1, y + 1, 120, 32, actor.name)
self.contents.font.color = normal_color
self.contents.draw_text(x, y, 120, 32, actor.name)
end
#=====================================
def draw_actor_level2(actor, x, y)
self.contents.font.name = $fontface
self.contents.font.color = outline_color
self.contents.draw_text(x - 1, y - 1, 32, 32, "Lv")
self.contents.draw_text(x - 1, y + 1, 32, 32, "Lv")
self.contents.draw_text(x + 1, y - 1, 32, 32, "Lv")
self.contents.draw_text(x + 1, y + 1, 32, 32, "Lv")
self.contents.font.color = Color.new(254, 230, 159, 255)
self.contents.draw_text(x, y, 32, 32, "Lv")
self.contents.font.color = outline_color
self.contents.draw_text(x + 31, y + 1, 24, 32, actor.level.to_s, 2)
self.contents.draw_text(x + 31, y - 1, 24, 32, actor.level.to_s, 2)
self.contents.draw_text(x + 33, y + 1, 24, 32, actor.level.to_s, 2)
self.contents.draw_text(x + 33, y - 1, 24, 32, actor.level.to_s, 2)
self.contents.font.color = normal_color
self.contents.draw_text(x + 32, y, 24, 32, actor.level.to_s, 2)
end
#=====================================
def draw_actor_class2(actor, x, y)
self.contents.font.name = "Black Chancery"
self.contents.font.color = outline_color
self.contents.draw_text(x + 1, y + 1, 236, 32, actor.class_name)
self.contents.draw_text(x + 1, y - 1, 236, 32, actor.class_name)
self.contents.draw_text(x - 1, y + 1, 236, 32, actor.class_name)
self.contents.draw_text(x - 1, y - 1, 236, 32, actor.class_name)
self.contents.font.color = Color.new(238, 139, 254, 255)
self.contents.draw_text(x, y, 236, 32, actor.class_name)
end
#======================================
def draw_actor_hp2(actor, x, y, width = 144)
self.contents.font.name = "Tahoma"
# 文字列 "HP" を描画
self.contents.font.size = 24
self.contents.font.color = outline_color
self.contents.draw_text(x + 1, y + 1, 32, 32, $data_system.words.hp)
self.contents.draw_text(x + 1, y - 1, 32, 32, $data_system.words.hp)
self.contents.draw_text(x - 1, y - 1, 32, 32, $data_system.words.hp)
self.contents.draw_text(x - 1, y + 1, 32, 32, $data_system.words.hp)
self.contents.font.color = Color.new(254, 238, 189, 255)
self.contents.draw_text(x, y, 32, 32, $data_system.words.hp)
# MaxHP を描画するスペースがあるか計算
if width - 32 >= 108
hp_x = x + width - 108
flag = true
elsif width - 32 >= 48
hp_x = x + width - 48
flag = false
end
# HP を描画
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
self.contents.font.color = outline_color
self.contents.draw_text(hp_x - 1, y - 1, 48, 32, actor.hp.to_s, 2)
self.contents.draw_text(hp_x - 1, y + 1, 48, 32, actor.hp.to_s, 2)
self.contents.draw_text(hp_x + 1, y + 1, 48, 32, actor.hp.to_s, 2)
self.contents.draw_text(hp_x + 1, y - 1, 48, 32, actor.hp.to_s, 2)
self.contents.font.color = actor.hp == 0 ? knockout_color :
actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color
self.contents.draw_text(hp_x, y, 48, 32, actor.hp.to_s, 2)
# MaxHP を描画
if flag
self.contents.font.color = outline_color
self.contents.draw_text(hp_x + 60 - 1, y - 1, 48, 32, actor.maxhp.to_s)
self.contents.draw_text(hp_x + 60 - 1, y + 1, 48, 32, actor.maxhp.to_s)
self.contents.draw_text(hp_x + 60 + 1, y - 1, 48, 32, actor.maxhp.to_s)
self.contents.draw_text(hp_x + 60 + 1, y + 1, 48, 32, actor.maxhp.to_s)
self.contents.draw_text(hp_x + 48 - 1, y - 1, 12, 32, "/", 1)
self.contents.draw_text(hp_x + 48 + 1, y + 1, 12, 32, "/", 1)
self.contents.draw_text(hp_x + 48 - 1, y + 1, 12, 32, "/", 1)
self.contents.draw_text(hp_x + 48 + 1, y - 1, 12, 32, "/", 1)
self.contents.font.color = normal_color
self.contents.draw_text(hp_x + 48, y, 12, 32, "/", 1)
self.contents.draw_text(hp_x + 60, y, 48, 32, actor.maxhp.to_s)
end
end
|
|