赞 | 0 |
VIP | 0 |
好人卡 | 0 |
积分 | 0 |
经验 | 0 |
最后登录 | 2008-5-26 |
在线时间 | 0 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 45
- 在线时间
- 0 小时
- 注册时间
- 2008-5-26
- 帖子
- 3
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
我用了闪烁标题的代码 为什么测试时什么东西都没有?
代码如下:
#==============================================================================
module PLAN_TITLE_NAME
TITLE_STR = "游戏标题名" # 标题名,自己改
FONT_NAME = ["黑体", "楷体", "宋体"] # 字体列表,当玩家电脑没有安装第一种字体会顺序往下寻找第二种
FONT_SIZE = 60 # 文字字号
FONT_BOLD = true # 加粗
FONT_ITALIC = false # 斜体
STR_COLOR = Color.new( 100, 110, 62) # 文字颜色
DRAW_FRAME = true # 文字是否勾边(true/false)
FRAME_COLOR = Color.new(0, 0, 0) # 勾边颜色
DRAW_X = 0 # X 座標修正値(相对中心)
DRAW_Y = -100 # Y 座標修正値(相对中心)
BLINK = true # 闪烁
end
#==============================================================================
# ■ Scene_Title
#==============================================================================
class Scene_Title
#--------------------------------------------------------------------------
# ● メイン処理
#--------------------------------------------------------------------------
alias plan_title_name_main main
def main
# 戦闘テストの場合
if $BTEST
battle_test
return
end
# スプライトの作成
@title_name_sprite = RPG::Sprite.new
@title_name_sprite.z = 100
bitmap = Bitmap.new(32, 32)
bitmap.font.name = PLAN_TITLE_NAME::FONT_NAME
bitmap.font.size = PLAN_TITLE_NAME::FONT_SIZE
bitmap.font.bold = PLAN_TITLE_NAME::FONT_BOLD
rect = bitmap.text_size(PLAN_TITLE_NAME::TITLE_STR)
bitmap.dispose
bitmap = nil
@title_name_sprite.bitmap = Bitmap.new(rect.width, rect.height)
@title_name_sprite.bitmap.font.name = PLAN_TITLE_NAME::FONT_NAME
@title_name_sprite.bitmap.font.size = PLAN_TITLE_NAME::FONT_SIZE
@title_name_sprite.bitmap.font.bold = PLAN_TITLE_NAME::FONT_BOLD
@title_name_sprite.bitmap.font.italic = PLAN_TITLE_NAME::FONT_ITALIC
str = PLAN_TITLE_NAME::TITLE_STR
if PLAN_TITLE_NAME::DRAW_FRAME
@title_name_sprite.bitmap.font.color = PLAN_TITLE_NAME::FRAME_COLOR
if defined?(@title_name_sprite.bitmap.draw_text_plan_frame)
@title_name_sprite.bitmap.draw_text_plan_frame(0, 0, rect.width, rect.height, str)
@title_name_sprite.bitmap.draw_text_plan_frame(2, 0, rect.width, rect.height, str)
@title_name_sprite.bitmap.draw_text_plan_frame(0, 2, rect.width, rect.height, str)
@title_name_sprite.bitmap.draw_text_plan_frame(2, 2, rect.width, rect.height, str)
@title_name_sprite.bitmap.font.color = PLAN_TITLE_NAME::STR_COLOR
@title_name_sprite.bitmap.draw_text_plan_frame(1, 1, rect.width, rect.height, str)
else
@title_name_sprite.bitmap.draw_text(0, 0, rect.width, rect.height, str)
@title_name_sprite.bitmap.draw_text(2, 0, rect.width, rect.height, str)
@title_name_sprite.bitmap.draw_text(0, 2, rect.width, rect.height, str)
@title_name_sprite.bitmap.draw_text(2, 2, rect.width, rect.height, str)
@title_name_sprite.bitmap.font.color = PLAN_TITLE_NAME::STR_COLOR
@title_name_sprite.bitmap.draw_text(1, 1, rect.width, rect.height, str)
end
else
@title_name_sprite.bitmap.font.color = PLAN_TITLE_NAME::STR_COLOR
@title_name_sprite.bitmap.draw_text(rect, str)
end
@title_name_sprite.x = 640 / 2 - rect.width / 2 + PLAN_TITLE_NAME::DRAW_X
@title_name_sprite.y = 480 / 2 - rect.height / 2 + PLAN_TITLE_NAME::DRAW_Y
@title_name_sprite.blink_on if PLAN_TITLE_NAME::BLINK
# 元のメソッドに戻す
plan_title_name_main
# スプライトの解放
@title_name_sprite.bitmap.dispose
@title_name_sprite.dispose
end
#--------------------------------------------------------------------------
# ● フレーム更新
#--------------------------------------------------------------------------
alias plan_title_name_update update
def update
# スプライトの更新
@title_name_sprite.update
# 元のメソッドに戻す
plan_title_name_update
end
end
|
|