赞 | 68 |
VIP | 397 |
好人卡 | 580 |
积分 | 22 |
经验 | 311270 |
最后登录 | 2022-3-9 |
在线时间 | 4033 小时 |
Lv3.寻梦者 (版主) …あたしは天使なんかじゃないわ
- 梦石
- 0
- 星屑
- 2208
- 在线时间
- 4033 小时
- 注册时间
- 2010-10-4
- 帖子
- 10779
|
本帖最后由 taroxd 于 2014-8-5 20:14 编辑
调坐标这种事情自己去干,在40~42行
23号开关开启时启用效果。开关ID在脚本第36行设置
默认效果如图:
@Cache
module Cache @cache ||= {} def self.ellipse(a, b, color) key = [:ellipse, a, b, color] unless include?(key) @cache[key] = bitmap = Bitmap.new(2 * a, 2 * b) 0.step(2*Math::PI, 0.01) do |theta| bitmap.set_pixel((a+a*Math.cos(theta)).to_i, (b+b*Math.sin(theta)).to_i, color) end end @cache[key] end end class Spriteset_Map alias cs_20140805 create_shadow def create_shadow cs_20140805 @ellipse_sprite = Sprite.new a, b, c = 50, 40, Color.new(255,0,0) @ellipse_sprite.bitmap = Cache.ellipse(a,b,c).clone @ellipse_sprite.bitmap.fill_rect(0, b, 2*a, 1, c) @mapinfo_sprite = Sprite.new @mapinfo_sprite.bitmap = Bitmap.new(2*a, 2*b) @mapinfo_sprite.bitmap.font.size = 16 @ellipse_sprite.x = 10 @ellipse_sprite.y = 10 @mapinfo_sprite.x = 10 @mapinfo_sprite.y = 10 end alias us_20140805 update_shadow def update_shadow us_20140805 @mapinfo_sprite.visible = @ellipse_sprite.visible = $game_switches[23] if @mapinfo_to_draw != mapinfo_to_draw n, x, y = @mapinfo_to_draw = mapinfo_to_draw text = "X:#{x} Y:#{y}" b = @mapinfo_sprite.bitmap b.clear b.draw_text(0,20,b.width,20,n,1) b.draw_text(0,40,b.width,20,text,1) end end alias ds_20140805 dispose_shadow def dispose_shadow ds_20140805 @ellipse_sprite.bitmap.dispose @ellipse_sprite.dispose @mapinfo_sprite.bitmap.dispose @mapinfo_sprite.dispose end def mapinfo_to_draw [$game_map.display_name, $game_player.x, $game_player.y] end end
module Cache
@cache ||= {}
def self.ellipse(a, b, color)
key = [:ellipse, a, b, color]
unless include?(key)
@cache[key] = bitmap = Bitmap.new(2 * a, 2 * b)
0.step(2*Math::PI, 0.01) do |theta|
bitmap.set_pixel((a+a*Math.cos(theta)).to_i,
(b+b*Math.sin(theta)).to_i, color)
end
end
@cache[key]
end
end
class Spriteset_Map
alias cs_20140805 create_shadow
def create_shadow
cs_20140805
@ellipse_sprite = Sprite.new
a, b, c = 50, 40, Color.new(255,0,0)
@ellipse_sprite.bitmap = Cache.ellipse(a,b,c).clone
@ellipse_sprite.bitmap.fill_rect(0, b, 2*a, 1, c)
@mapinfo_sprite = Sprite.new
@mapinfo_sprite.bitmap = Bitmap.new(2*a, 2*b)
@mapinfo_sprite.bitmap.font.size = 16
@ellipse_sprite.x = 10
@ellipse_sprite.y = 10
@mapinfo_sprite.x = 10
@mapinfo_sprite.y = 10
end
alias us_20140805 update_shadow
def update_shadow
us_20140805
@mapinfo_sprite.visible = @ellipse_sprite.visible = $game_switches[23]
if @mapinfo_to_draw != mapinfo_to_draw
n, x, y = @mapinfo_to_draw = mapinfo_to_draw
text = "X:#{x} Y:#{y}"
b = @mapinfo_sprite.bitmap
b.clear
b.draw_text(0,20,b.width,20,n,1)
b.draw_text(0,40,b.width,20,text,1)
end
end
alias ds_20140805 dispose_shadow
def dispose_shadow
ds_20140805
@ellipse_sprite.bitmap.dispose
@ellipse_sprite.dispose
@mapinfo_sprite.bitmap.dispose
@mapinfo_sprite.dispose
end
def mapinfo_to_draw
[$game_map.display_name, $game_player.x, $game_player.y]
end
end
|
评分
-
查看全部评分
|