设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 1658|回复: 6
打印 上一主题 下一主题

[已经过期] 如何提高动画坐标X\Y的最大最小值?

[复制链接]

Lv5.捕梦者 (版主)

梦石
20
星屑
1840
在线时间
6925 小时
注册时间
2012-12-14
帖子
11485

短篇十战斗者组别冠军开拓者贵宾短篇九勇士组亚军

跳转到指定楼层
1
发表于 2013-8-11 21:10:24 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有帐号?注册会员

x


160的限制实在太小了
请问有什么方法提高这个的最大最小值?
大家好,这里是晨露的说。请多多指教。
刚入门RM软件制作,请大家多多帮助我哦。
落雪君的欢乐像素教程,欢迎查阅。

Lv2.观梦者 (暗夜天使)

万兽

梦石
0
星屑
597
在线时间
2271 小时
注册时间
2006-11-4
帖子
4868

贵宾

2
发表于 2013-8-11 21:13:34 | 只看该作者
这个要从软件上下手,另外XP的DLL不像VX VA,是加过壳的,所以除非有人破解,不然没办法修改这里。
回复 支持 反对

使用道具 举报

Lv5.捕梦者 (版主)

梦石
20
星屑
1840
在线时间
6925 小时
注册时间
2012-12-14
帖子
11485

短篇十战斗者组别冠军开拓者贵宾短篇九勇士组亚军

3
 楼主| 发表于 2013-8-11 21:16:17 | 只看该作者
弗雷德 发表于 2013-8-11 21:13
这个要从软件上下手,另外XP的DLL不像VX VA,是加过壳的,所以除非有人破解,不然没办法修改这里。 ...

脚本可以隐性的让动画原件超过这个数值吗?
大家好,这里是晨露的说。请多多指教。
刚入门RM软件制作,请大家多多帮助我哦。
落雪君的欢乐像素教程,欢迎查阅。

回复 支持 反对

使用道具 举报

Lv2.观梦者 (暗夜天使)

万兽

梦石
0
星屑
597
在线时间
2271 小时
注册时间
2006-11-4
帖子
4868

贵宾

4
发表于 2013-8-11 21:18:09 | 只看该作者
美丽晨露 发表于 2013-8-11 21:16
脚本可以隐性的让动画原件超过这个数值吗?

动画是个精灵,要想直接修改动画内部图像的数据,估计得涉及到结构什么的了,问问这货:@end55rpg  
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
3570
在线时间
3064 小时
注册时间
2011-11-17
帖子
980
5
发表于 2013-8-11 22:22:14 | 只看该作者
用连续图片 替代 动画编辑器   

点评

表示不太懂您的意思······  发表于 2013-8-11 22:55
回复 支持 反对

使用道具 举报

Lv5.捕梦者 (版主)

梦石
20
星屑
1840
在线时间
6925 小时
注册时间
2012-12-14
帖子
11485

短篇十战斗者组别冠军开拓者贵宾短篇九勇士组亚军

6
 楼主| 发表于 2013-8-11 22:27:09 | 只看该作者
yagami 发表于 2013-8-11 22:22
用连续图片 替代 动画编辑器

那样图片素材是会非常的多······
而且我的脚本是直接调用动画编辑器内的动画的

点评

主体与光效分离 主体用连续图片 光效 用动画编辑器 利用放大 画质影响不大 把显示图片和动画的视口弄在一个平面上 这样Z值也能搞定了  发表于 2013-8-11 22:50
大家好,这里是晨露的说。请多多指教。
刚入门RM软件制作,请大家多多帮助我哦。
落雪君的欢乐像素教程,欢迎查阅。

回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
687
在线时间
791 小时
注册时间
2011-10-20
帖子
2394

开拓者

7
发表于 2013-8-11 22:55:30 | 只看该作者
  1. module RPG
  2.   class Sprite < ::Sprite
  3.     @@_animations = []
  4.     @@_reference_count = {}
  5.     def initialize(viewport = nil)
  6.       super(viewport)
  7.       @_whiten_duration = 0
  8.       @_appear_duration = 0
  9.       @_escape_duration = 0
  10.       @_collapse_duration = 0
  11.       @_damage_duration = 0
  12.       @_animation_duration = 0
  13.       @_blink = false
  14.     end
  15.     def dispose
  16.       dispose_damage
  17.       dispose_animation
  18.       dispose_loop_animation
  19.       super
  20.     end
  21.     def whiten
  22.       self.blend_type = 0
  23.       self.color.set(255, 255, 255, 128)
  24.       self.opacity = 255
  25.       @_whiten_duration = 16
  26.       @_appear_duration = 0
  27.       @_escape_duration = 0
  28.       @_collapse_duration = 0
  29.     end
  30.     def appear
  31.       self.blend_type = 0
  32.       self.color.set(0, 0, 0, 0)
  33.       self.opacity = 0
  34.       @_appear_duration = 16
  35.       @_whiten_duration = 0
  36.       @_escape_duration = 0
  37.       @_collapse_duration = 0
  38.     end
  39.     def escape
  40.       self.blend_type = 0
  41.       self.color.set(0, 0, 0, 0)
  42.       self.opacity = 255
  43.       @_escape_duration = 32
  44.       @_whiten_duration = 0
  45.       @_appear_duration = 0
  46.       @_collapse_duration = 0
  47.     end
  48.     def collapse
  49.       self.blend_type = 1
  50.       self.color.set(255, 64, 64, 255)
  51.       self.opacity = 255
  52.       @_collapse_duration = 48
  53.       @_whiten_duration = 0
  54.       @_appear_duration = 0
  55.       @_escape_duration = 0
  56.     end
  57.     def damage(value, critical)
  58.       dispose_damage
  59.       if value.is_a?(Numeric)
  60.         damage_string = value.abs.to_s
  61.       else
  62.         damage_string = value.to_s
  63.       end
  64.       bitmap = Bitmap.new(160, 48)
  65.       bitmap.font.name = "Arial Black"
  66.       bitmap.font.size = 32
  67.       bitmap.font.color.set(0, 0, 0)
  68.       bitmap.draw_text(-1, 12-1, 160, 36, damage_string, 1)
  69.       bitmap.draw_text(+1, 12-1, 160, 36, damage_string, 1)
  70.       bitmap.draw_text(-1, 12+1, 160, 36, damage_string, 1)
  71.       bitmap.draw_text(+1, 12+1, 160, 36, damage_string, 1)
  72.       if value.is_a?(Numeric) and value < 0
  73.         bitmap.font.color.set(176, 255, 144)
  74.       else
  75.         bitmap.font.color.set(255, 255, 255)
  76.       end
  77.       bitmap.draw_text(0, 12, 160, 36, damage_string, 1)
  78.       if critical
  79.         bitmap.font.size = 20
  80.         bitmap.font.color.set(0, 0, 0)
  81.         bitmap.draw_text(-1, -1, 160, 20, "CRITICAL", 1)
  82.         bitmap.draw_text(+1, -1, 160, 20, "CRITICAL", 1)
  83.         bitmap.draw_text(-1, +1, 160, 20, "CRITICAL", 1)
  84.         bitmap.draw_text(+1, +1, 160, 20, "CRITICAL", 1)
  85.         bitmap.font.color.set(255, 255, 255)
  86.         bitmap.draw_text(0, 0, 160, 20, "CRITICAL", 1)
  87.       end
  88.       @_damage_sprite = ::Sprite.new(self.viewport)
  89.       @_damage_sprite.bitmap = bitmap
  90.       @_damage_sprite.ox = 80
  91.       @_damage_sprite.oy = 20
  92.       @_damage_sprite.x = self.x
  93.       @_damage_sprite.y = self.y - self.oy / 2
  94.       @_damage_sprite.z = 3000
  95.       @_damage_duration = 40
  96.     end
  97.     def animation(animation, hit)
  98.       dispose_animation
  99.       @_animation = animation
  100.       return if @_animation == nil
  101.       @_animation_hit = hit
  102.       @_animation_duration = @_animation.frame_max
  103.       animation_name = @_animation.animation_name
  104.       animation_hue = @_animation.animation_hue
  105.       bitmap = RPG::Cache.animation(animation_name, animation_hue)
  106.       if @@_reference_count.include?(bitmap)
  107.         @@_reference_count[bitmap] += 1
  108.       else
  109.         @@_reference_count[bitmap] = 1
  110.       end
  111.       @_animation_sprites = []
  112.       if @_animation.position != 3 or not @@_animations.include?(animation)
  113.         for i in 0..15
  114.           sprite = ::Sprite.new(self.viewport)
  115.           sprite.bitmap = bitmap
  116.           sprite.visible = false
  117.           @_animation_sprites.push(sprite)
  118.         end
  119.         unless @@_animations.include?(animation)
  120.           @@_animations.push(animation)
  121.         end
  122.       end
  123.       update_animation
  124.     end
  125.     def loop_animation(animation)
  126.       return if animation == @_loop_animation
  127.       dispose_loop_animation
  128.       @_loop_animation = animation
  129.       return if @_loop_animation == nil
  130.       @_loop_animation_index = 0
  131.       animation_name = @_loop_animation.animation_name
  132.       animation_hue = @_loop_animation.animation_hue
  133.       bitmap = RPG::Cache.animation(animation_name, animation_hue)
  134.       if @@_reference_count.include?(bitmap)
  135.         @@_reference_count[bitmap] += 1
  136.       else
  137.         @@_reference_count[bitmap] = 1
  138.       end
  139.       @_loop_animation_sprites = []
  140.       for i in 0..15
  141.         sprite = ::Sprite.new(self.viewport)
  142.         sprite.bitmap = bitmap
  143.         sprite.visible = false
  144.         @_loop_animation_sprites.push(sprite)
  145.       end
  146.       update_loop_animation
  147.     end
  148.     def dispose_damage
  149.       if @_damage_sprite != nil
  150.         @_damage_sprite.bitmap.dispose
  151.         @_damage_sprite.dispose
  152.         @_damage_sprite = nil
  153.         @_damage_duration = 0
  154.       end
  155.     end
  156.     def dispose_animation
  157.       if @_animation_sprites != nil
  158.         sprite = @_animation_sprites[0]
  159.         if sprite != nil
  160.           @@_reference_count[sprite.bitmap] -= 1
  161.           if @@_reference_count[sprite.bitmap] == 0
  162.             sprite.bitmap.dispose
  163.           end
  164.         end
  165.         for sprite in @_animation_sprites
  166.           sprite.dispose
  167.         end
  168.         @_animation_sprites = nil
  169.         @_animation = nil
  170.       end
  171.     end
  172.     def dispose_loop_animation
  173.       if @_loop_animation_sprites != nil
  174.         sprite = @_loop_animation_sprites[0]
  175.         if sprite != nil
  176.           @@_reference_count[sprite.bitmap] -= 1
  177.           if @@_reference_count[sprite.bitmap] == 0
  178.             sprite.bitmap.dispose
  179.           end
  180.         end
  181.         for sprite in @_loop_animation_sprites
  182.           sprite.dispose
  183.         end
  184.         @_loop_animation_sprites = nil
  185.         @_loop_animation = nil
  186.       end
  187.     end
  188.     def blink_on
  189.       unless @_blink
  190.         @_blink = true
  191.         @_blink_count = 0
  192.       end
  193.     end
  194.     def blink_off
  195.       if @_blink
  196.         @_blink = false
  197.         self.color.set(0, 0, 0, 0)
  198.       end
  199.     end
  200.     def blink?
  201.       @_blink
  202.     end
  203.     def effect?
  204.       @_whiten_duration > 0 or
  205.       @_appear_duration > 0 or
  206.       @_escape_duration > 0 or
  207.       @_collapse_duration > 0 or
  208.       @_damage_duration > 0 or
  209.       @_animation_duration > 0
  210.     end
  211.     def update
  212.       super
  213.       if @_whiten_duration > 0
  214.         @_whiten_duration -= 1
  215.         self.color.alpha = 128 - (16 - @_whiten_duration) * 10
  216.       end
  217.       if @_appear_duration > 0
  218.         @_appear_duration -= 1
  219.         self.opacity = (16 - @_appear_duration) * 16
  220.       end
  221.       if @_escape_duration > 0
  222.         @_escape_duration -= 1
  223.         self.opacity = 256 - (32 - @_escape_duration) * 10
  224.       end
  225.       if @_collapse_duration > 0
  226.         @_collapse_duration -= 1
  227.         self.opacity = 256 - (48 - @_collapse_duration) * 6
  228.       end
  229.       if @_damage_duration > 0
  230.         @_damage_duration -= 1
  231.         case @_damage_duration
  232.         when 38..39
  233.           @_damage_sprite.y -= 4
  234.         when 36..37
  235.           @_damage_sprite.y -= 2
  236.         when 34..35
  237.           @_damage_sprite.y += 2
  238.         when 28..33
  239.           @_damage_sprite.y += 4
  240.         end
  241.         @_damage_sprite.opacity = 256 - (12 - @_damage_duration) * 32
  242.         if @_damage_duration == 0
  243.           dispose_damage
  244.         end
  245.       end
  246.       if @_animation != nil and (Graphics.frame_count % 2 == 0)
  247.         @_animation_duration -= 1
  248.         update_animation
  249.       end
  250.       if @_loop_animation != nil and (Graphics.frame_count % 2 == 0)
  251.         update_loop_animation
  252.         @_loop_animation_index += 1
  253.         @_loop_animation_index %= @_loop_animation.frame_max
  254.       end
  255.       if @_blink
  256.         @_blink_count = (@_blink_count + 1) % 32
  257.         if @_blink_count < 16
  258.           alpha = (16 - @_blink_count) * 6
  259.         else
  260.           alpha = (@_blink_count - 16) * 6
  261.         end
  262.         self.color.set(255, 255, 255, alpha)
  263.       end
  264.       @@_animations.clear
  265.     end
  266.     def update_animation
  267.       if @_animation_duration > 0
  268.         frame_index = @_animation.frame_max - @_animation_duration
  269.         cell_data = @_animation.frames[frame_index].cell_data
  270.         position = @_animation.position
  271.         animation_set_sprites(@_animation_sprites, cell_data, position)
  272.         for timing in @_animation.timings
  273.           if timing.frame == frame_index
  274.             animation_process_timing(timing, @_animation_hit)
  275.           end
  276.         end
  277.       else
  278.         dispose_animation
  279.       end
  280.     end
  281.     def update_loop_animation
  282.       frame_index = @_loop_animation_index
  283.       cell_data = @_loop_animation.frames[frame_index].cell_data
  284.       position = @_loop_animation.position
  285.       animation_set_sprites(@_loop_animation_sprites, cell_data, position)
  286.       for timing in @_loop_animation.timings
  287.         if timing.frame == frame_index
  288.           animation_process_timing(timing, true)
  289.         end
  290.       end
  291.     end
  292.     def animation_set_sprites(sprites, cell_data, position)
  293.       for i in 0..15
  294.         sprite = sprites[i]
  295.         pattern = cell_data[i, 0]
  296.         if sprite == nil or pattern == nil or pattern == -1
  297.           sprite.visible = false if sprite != nil
  298.           next
  299.         end
  300.         sprite.visible = true
  301.         sprite.src_rect.set(pattern % 5 * 192, pattern / 5 * 192, 192, 192)
  302.         if position == 3
  303.           if self.viewport != nil
  304.             sprite.x = self.viewport.rect.width / 2
  305.             sprite.y = self.viewport.rect.height - 160
  306.           else
  307.             sprite.x = 320
  308.             sprite.y = 240
  309.           end
  310.         else
  311.           sprite.x = self.x - self.ox + self.src_rect.width / 2
  312.           sprite.y = self.y - self.oy + self.src_rect.height / 2
  313.           sprite.y -= self.src_rect.height / 4 if position == 0
  314.           sprite.y += self.src_rect.height / 4 if position == 2
  315.         end
  316.         sprite.x += cell_data[i, 1]
  317.         sprite.y += cell_data[i, 2]
  318.         sprite.z = 2000
  319.         sprite.ox = 96
  320.         sprite.oy = 96
  321.         sprite.zoom_x = cell_data[i, 3] / 100.0
  322.         sprite.zoom_y = cell_data[i, 3] / 100.0
  323.         sprite.angle = cell_data[i, 4]
  324.         sprite.mirror = (cell_data[i, 5] == 1)
  325.         sprite.opacity = cell_data[i, 6] * self.opacity / 255.0
  326.         sprite.blend_type = cell_data[i, 7]
  327.       end
  328.     end
  329.     def animation_process_timing(timing, hit)
  330.       if (timing.condition == 0) or
  331.          (timing.condition == 1 and hit == true) or
  332.          (timing.condition == 2 and hit == false)
  333.         if timing.se.name != ""
  334.           se = timing.se
  335.           Audio.se_play("Audio/SE/" + se.name, se.volume, se.pitch)
  336.         end
  337.         case timing.flash_scope
  338.         when 1
  339.           self.flash(timing.flash_color, timing.flash_duration * 2)
  340.         when 2
  341.           if self.viewport != nil
  342.             self.viewport.flash(timing.flash_color, timing.flash_duration * 2)
  343.           end
  344.         when 3
  345.           self.flash(nil, timing.flash_duration * 2)
  346.         end
  347.       end
  348.     end
  349.     def x=(x)
  350.       sx = x - self.x
  351.       if sx != 0
  352.         if @_animation_sprites != nil
  353.           for i in 0..15
  354.             @_animation_sprites[i].x += sx
  355.           end
  356.         end
  357.         if @_loop_animation_sprites != nil
  358.           for i in 0..15
  359.             @_loop_animation_sprites[i].x += sx
  360.           end
  361.         end
  362.       end
  363.       super
  364.     end
  365.     def y=(y)
  366.       sy = y - self.y
  367.       if sy != 0
  368.         if @_animation_sprites != nil
  369.           for i in 0..15
  370.             @_animation_sprites[i].y += sy
  371.           end
  372.         end
  373.         if @_loop_animation_sprites != nil
  374.           for i in 0..15
  375.             @_loop_animation_sprites[i].y += sy
  376.           end
  377.         end
  378.       end
  379.       super
  380.     end
  381.   end
  382. end
复制代码
帮助手册里的
def animation_set_sprites这里面

sprite.x += cell_data[i, 1]
        sprite.y += cell_data[i, 2]
就是设置的动画data坐标
你可以判断i(应该是帧吧)和animationID在什么时候
sprite.xy+-=XXXX
这样就行了,不过麻烦,要不然人家怎么做编辑器。。。

评分

参与人数 2星屑 +125 收起 理由
弗雷德 + 105 认可答案
美丽晨露 + 20 好复杂

查看全部评分

欢迎点此进入我的egames.wink.ws,有RMQQ堂等

[url=http://rpg.blue/thread-317273-1-1.html]短篇八-赶选

http://yun.baidu.com/share/link?shareid=2158225779&uk=169642147&third=0


历险ARPG赢回你的疆域新的战斗模式?…………点击这里:[宋乱贼狂 for QQ堂]
http://rpg.blue/group-368-1.html
programing ....?
[url=http://rpg.blue/thrd-234658-1-1.html]
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-9-21 14:33

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表