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

Project1

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

[已经解决] 【图片运动】 像这种运动轨迹是要怎么处理?

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
521 小时
注册时间
2011-12-7
帖子
305
跳转到指定楼层
1
发表于 2013-8-22 17:29:04 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本帖最后由 Ceopal 于 2013-8-22 17:46 编辑


原点在图片外面?不会吧……运动后它的角度怎么办?

这种孤线运动轨迹,思路是什么呢?




@fangyc  原点设在哪都阻止不了红球的自转吧?红球好像是不应该自转的……注:那个红球之外的是不动的,球是要动的……

    PS: 只是用素材……续写轨迹什么的,我文字不好……乱入下轨迹的世界观还是可以的……

Lv1.梦旅人

梦石
0
星屑
50
在线时间
79 小时
注册时间
2007-6-23
帖子
154
2
发表于 2013-8-22 17:34:56 | 只看该作者
可以调用Sprite的angle(旋转角度)方法来旋转图片,原点(ox,oy)设在图片中心(width/2, height/2)
话说楼主在做轨迹的游戏吗?
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
79 小时
注册时间
2007-6-23
帖子
154
3
发表于 2013-8-22 17:50:44 手机端发表。 | 只看该作者
那你得吧图切开 用不同的sprite来显示吧
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
34 小时
注册时间
2013-8-5
帖子
12
4
发表于 2013-8-22 17:54:24 | 只看该作者
1、参考圆的方程(初中数学水平),然后确定x,y
2、参考六边形,做法也不难但效果也不差

点评

我会告诉你我们是到高一才教圆的方程吗?(好吧初中的这几年好多东西都删了= =)  发表于 2013-8-22 18:48
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
55
在线时间
323 小时
注册时间
2010-8-21
帖子
666
5
发表于 2013-8-22 17:55:13 | 只看该作者
本帖最后由 沙漠点灰 于 2013-8-22 20:46 编辑

圆的话,事先生成一个数组,数组包含坐标信息
  1. PRECISION = 360
  2. RADIU     = 100
  3. a = (0...PRECISION).inject([]){|a,b|a<<[(RADIU*Math.cos(b*2*Math::PI/PRECISION)).to_i, (RADIU*Math.sin(b*2*Math::PI/PRECISION)).to_i]}
复制代码
PRECISION表示划分的精度,RADIU代表半径
这样a里面保存的就是坐标信息,可以在游戏开始设为常量。这样何以匀速转动,如果非匀速的话,
可以把PRECISION设置高点,用一个浮点变量作为位置信息,使用时取整就行

评分

参与人数 2星屑 +105 收起 理由
Sion + 100 感谢帮忙
化螺耕 + 5 我很赞同

查看全部评分

>>猛戳>>MetalSagaR游戏主页<<这里<<
欢迎提供您的意见
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
448 小时
注册时间
2012-1-30
帖子
41
6
发表于 2013-8-22 19:52:58 | 只看该作者
这个用六边形的移动方法就差不多了
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
60
在线时间
705 小时
注册时间
2007-12-23
帖子
874
7
发表于 2013-8-22 21:01:27 | 只看该作者
做动画一帧一桢贴上去
买了正版RMMV的同学进来看一下,谢谢~
https://rpg.blue/thread-393237-1-1.html
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
117
在线时间
552 小时
注册时间
2012-8-18
帖子
1429
8
发表于 2013-8-23 08:28:55 | 只看该作者
用极坐标系记录位置,刷新的时候用三角函数转换 oxoy要放在图片中心
强烈求素材,当初做过这种菜单,没素材不好看就放弃了
我要填坑!我要背单词!我要学日语!我要每天锻炼!
好吧呵呵= =
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
367
在线时间
1292 小时
注册时间
2013-1-12
帖子
3590

贵宾

9
发表于 2013-8-23 10:00:21 | 只看该作者
這菜單是我翻到的
拿去看看也許有用?
  1. #==============================================================================
  2. # ** Ring Menu
  3. #------------------------------------------------------------------------------
  4. #  by Syvkal
  5. #  Version 1.2
  6. #  03-04-12
  7. #------------------------------------------------------------------------------
  8. # * Original available at:
  9. #  www.rpgmakervxace.net  &  forums.rpgmakerweb.com
  10. #  Please do not redistribute this script
  11. #------------------------------------------------------------------------------
  12. # * Terms of Use
  13. #  Available for use in commercial games provided that I get a free copy :P
  14. #  Email me: [email protected]
  15. #  Please do not redistribute this script
  16. #==============================================================================
  17. #
  18. #  - INTRODUCTION -
  19. #
  20. #  This system implements a Plug 'N' Play Ring Menu
  21. #  Movement based off XRXS, Dubealex & Hypershadow180's original XP Ring Menu,
  22. #  which was devised through some simple, but clever trigonometry
  23. #
  24. #------------------------------------------------------------------------------
  25. #
  26. #  - USAGE -
  27. #
  28. #  Any additional scenes that are added to the menu require an icon
  29. #  Place them in the pictures folder, they are advised to be 48x48 pixels
  30. #
  31. #  The name of the icons must be of the form:
  32. #    [Command Name] Icon
  33. #
  34. #  For example 'Items Icon.png' or 'Equipment Icon.png'
  35. #
  36. #  If you are unsure what it needs to be called, wait for the error message,
  37. #  then call it the name of the file it can not find
  38. #
  39. #------------------------------------------------------------------------------
  40. #
  41. #  - COMPATIBILITY -
  42. #
  43. #  Additional scenes should be automatically added assuming thier creators
  44. #  utilise the 'add_original_commands' feature in Window_MenuCommand
  45. #
  46. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  47. #
  48. #  This script redefines the following methods:
  49. #  * create_status_window             (Scene_Menu)
  50. #  * on_formation_ok                  (Scene_Menu)
  51. #  * on_formation_cancel              (Scene_Menu)
  52. #  * draw_character                   (Window_Base)
  53. #
  54. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  55. #
  56. #  This script Aliases the following methods:
  57. #  * add_save_command                 (Window_MenuCommand)
  58. #  * start                            (Scene_Menu)
  59. #  * create_command_window            (Scene_Menu)
  60. #  * command_personal                 (Scene_Menu)
  61. #  * command_formation                (Scene_Menu)
  62. #  * on_personal_cancel               (Scene_Menu)
  63. #
  64. #==============================================================================

  65.             #===================================================#
  66.             #  **  C O N F I G U R A T I O N   S Y S T E M  **  #
  67.             #===================================================#
  68.   
  69.   #--------------------------------------------------------------------------
  70.   # * Startup Frames
  71.   # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  72.   #  Amount of frames for the Startup Animation
  73.   #--------------------------------------------------------------------------
  74.     STARTUP_FRAMES = 20
  75.   #--------------------------------------------------------------------------
  76.   # * Movement Frames
  77.   # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  78.   #  Amount of frames for Movement Animation
  79.   #--------------------------------------------------------------------------
  80.     MOVING_FRAMES = 15
  81.   #--------------------------------------------------------------------------
  82.   # * Menu Ring Radius
  83.   # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  84.   #  Radius of the Menu Ring
  85.   #--------------------------------------------------------------------------
  86.     RING_R = 75
  87.   #--------------------------------------------------------------------------
  88.   # * Show Disabled Options
  89.   # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  90.   #  Set to false to exclude disabled options for the menu
  91.   #--------------------------------------------------------------------------
  92.     DISABLED_SHOW = true
  93.   #--------------------------------------------------------------------------
  94.   # * Disabled Icon
  95.   # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  96.   #  The icon displayed over disabled options
  97.   #  (only used when DISABLED_SHOW =  true)
  98.   #--------------------------------------------------------------------------
  99.     ICON_DISABLE = Cache::picture('0004351yvn9a5fiflfjx88.png')
  100.   #--------------------------------------------------------------------------
  101.   # * Skip Single Actor Select
  102.   # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  103.   #  Set to true to skip the actor selection if there's only one party member
  104.   #--------------------------------------------------------------------------
  105.     ACTOR_SKIP = true
  106.   #--------------------------------------------------------------------------
  107.   # * Load Command Vocab
  108.   # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  109.   #  Text displayed for the loading option
  110.   #--------------------------------------------------------------------------
  111.     Vocab::Load = "Load"
  112.       
  113.             #===================================================#
  114.             #  **     E N D   C O N F I G U R A T I O N     **  #
  115.             #===================================================#

  116. #==============================================================================
  117. # ** Ring_Menu Module
  118. #------------------------------------------------------------------------------
  119. #  Module designed to rewrite methods defined in the desired Superclass.
  120. #==============================================================================

  121. module Ring_Menu
  122.   #--------------------------------------------------------------------------
  123.   # * Object Initialization
  124.   #--------------------------------------------------------------------------
  125.   def initialize(*args)
  126.     super(*args)
  127.     @cx = contents.width / 2; @cy = contents.height / 2
  128.     self.opacity = 0
  129.     @startup = STARTUP_FRAMES
  130.     @icons = []
  131.     @mode = :start
  132.     @steps = @startup
  133.   end
  134.   #--------------------------------------------------------------------------
  135.   # * Update Cursor
  136.   #--------------------------------------------------------------------------
  137.   def update_cursor
  138.   end
  139.   #--------------------------------------------------------------------------
  140.   # * Determines if is moving
  141.   #--------------------------------------------------------------------------
  142.   def animation?
  143.     return @mode != :wait
  144.   end
  145.   #--------------------------------------------------------------------------
  146.   # * Move Cursor Down
  147.   #--------------------------------------------------------------------------
  148.   def cursor_down(wrap)
  149.     cursor_right(wrap)
  150.   end
  151.   #--------------------------------------------------------------------------
  152.   # * Move Cursor Up
  153.   #--------------------------------------------------------------------------
  154.   def cursor_up(wrap)
  155.     cursor_left(wrap)
  156.   end
  157.   #--------------------------------------------------------------------------
  158.   # * Move Cursor Right
  159.   #--------------------------------------------------------------------------
  160.   def cursor_right(wrap)
  161.     unless animation?
  162.       select((index + 1) % item_max)
  163.       @mode = :mover
  164.       @steps = MOVING_FRAMES
  165.       Sound.play_cursor
  166.     end
  167.   end
  168.   #--------------------------------------------------------------------------
  169.   # * Move Cursor Left
  170.   #--------------------------------------------------------------------------
  171.   def cursor_left(wrap)
  172.     unless animation?
  173.       select((index - 1 + item_max) % item_max)
  174.       @mode = :movel
  175.       @steps = MOVING_FRAMES
  176.       Sound.play_cursor
  177.     end
  178.   end
  179.   #--------------------------------------------------------------------------
  180.   # * Frame Update
  181.   #--------------------------------------------------------------------------
  182.   def update
  183.     super
  184.     refresh if animation?
  185.   end
  186.   #--------------------------------------------------------------------------
  187.   # * Refresh
  188.   #--------------------------------------------------------------------------
  189.   def refresh   
  190.     self.contents.clear
  191.     case @mode
  192.     when :start
  193.       refresh_start
  194.     when :wait
  195.       refresh_wait
  196.     when :mover
  197.       refresh_move(1)
  198.     when :movel
  199.       refresh_move(0)
  200.     end
  201.   end
  202.   #--------------------------------------------------------------------------
  203.   # * Refresh Start Period
  204.   #--------------------------------------------------------------------------
  205.   def refresh_start
  206.     d1 = 2.0 * Math::PI / item_max
  207.     d2 = 1.0 * Math::PI / @startup
  208.     r = RING_R - 1.0 * RING_R * @steps / @startup
  209.     for i in 0...item_max
  210.       d = d1 * i + d2 * @steps
  211.       x = @cx + ( r * Math.sin( d ) ).to_i
  212.       y = @cy - ( r * Math.cos( d ) ).to_i
  213.       draw_item(x, y, i)
  214.     end
  215.     @steps -= 1
  216.     if @steps < 0
  217.       @mode = :wait
  218.     end
  219.   end
  220.   #--------------------------------------------------------------------------
  221.   # * Refresh Wait Period
  222.   #--------------------------------------------------------------------------
  223.   def refresh_wait
  224.     d = 2.0 * Math::PI / item_max
  225.     for i in 0...item_max
  226.       j = i - index
  227.       x = @cx + ( RING_R * Math.sin( d * j) ).to_i
  228.       y = @cy - ( RING_R * Math.cos( d * j) ).to_i
  229.       draw_item(x, y, i)
  230.     end
  231.   end
  232.   #--------------------------------------------------------------------------
  233.   # * Refresh Movement Period
  234.   #--------------------------------------------------------------------------
  235.   def refresh_move( mode )
  236.     d1 = 2.0 * Math::PI / item_max
  237.     d2 = d1 / MOVING_FRAMES
  238.     d2 *= -1 unless mode != 0
  239.     for i in 0...item_max
  240.       j = i - index
  241.       d = d1 * j + d2 * @steps
  242.       x = @cx + ( RING_R * Math.sin( d ) ).to_i
  243.       y = @cy - ( RING_R * Math.cos( d ) ).to_i
  244.       draw_item(x, y, i)
  245.     end
  246.     @steps -= 1
  247.     if @steps < 0
  248.       @mode = :wait
  249.     end
  250.   end
  251. end

  252. #==============================================================================
  253. # ** Window_MenuCommand
  254. #------------------------------------------------------------------------------
  255. #  Converted into a Ring Menu.
  256. #==============================================================================

  257. class Window_MenuCommand < Window_Command
  258.   #--------------------------------------------------------------------------
  259.   # * Includes The Ring_Menu Module
  260.   #--------------------------------------------------------------------------  
  261.   include Ring_Menu
  262.   #--------------------------------------------------------------------------
  263.   # * Alias Listings
  264.   #--------------------------------------------------------------------------  
  265.   alias add_save_command_ring_menu_original add_save_command
  266.   #--------------------------------------------------------------------------
  267.   # * Object Initialization
  268.   #--------------------------------------------------------------------------
  269.   def initialize
  270.     super(0, 0)
  271.     unless DISABLED_SHOW
  272.       @list.delete_if {|i| !i[:enabled]}
  273.     end
  274.     for i in 0...item_max
  275.       @icons.push(Cache::picture(command_name(i) + ' Icon'))
  276.     end
  277.     if @@last_command_symbol != nil
  278.       index = @list.index(@@last_command_symbol)
  279.       @mode = :wait
  280.     end
  281.     select_last
  282.     refresh
  283.   end
  284.   #--------------------------------------------------------------------------
  285.   # * Refresh
  286.   #--------------------------------------------------------------------------
  287.   def refresh
  288.     super
  289.     rect = Rect.new(0, 196, self.contents.width, line_height)
  290.     draw_text(rect, command_name(index), 1)
  291.   end
  292.   #--------------------------------------------------------------------------
  293.   # * Get Window Width
  294.   #--------------------------------------------------------------------------
  295.   def window_width
  296.     return 544
  297.   end
  298.   #--------------------------------------------------------------------------
  299.   # * Get Window Height
  300.   #--------------------------------------------------------------------------
  301.   def window_height
  302.     return 416
  303.   end  
  304.   #--------------------------------------------------------------------------
  305.   # * Add Load to Command List
  306.   #--------------------------------------------------------------------------
  307.   def add_save_command
  308.     add_save_command_ring_menu_original
  309.     add_command(Vocab::Load, :load)
  310.   end
  311.   #--------------------------------------------------------------------------
  312.   # * Draw Item
  313.   #     x     : draw spot x-coordinate
  314.   #     y     : draw spot y-coordinate
  315.   #     i     : item number
  316.   #--------------------------------------------------------------------------
  317.   def draw_item(x, y, i)
  318.     rect = Rect.new(0, 0, @icons[i].width, @icons[i].height)
  319.     if i == index
  320.       self.contents.blt(x - rect.width/2, y - rect.height/2, @icons[i], rect )
  321.       unless command_enabled?(index)
  322.         self.contents.blt(x - rect.width/2, y - rect.height/2, ICON_DISABLE, rect )
  323.       end
  324.     else
  325.       self.contents.blt(x - rect.width/2, y - rect.height/2, @icons[i], rect, 128 )
  326.     end
  327.   end
  328. end

  329. #==============================================================================
  330. # ** Window_RingStatus
  331. #------------------------------------------------------------------------------
  332. #  Ring Menu for selection of Party Members
  333. #==============================================================================

  334. class Window_RingStatus < Window_Selectable
  335.   #--------------------------------------------------------------------------
  336.   # * Includes The Ring_Menu Module
  337.   #--------------------------------------------------------------------------  
  338.   include Ring_Menu
  339.   #--------------------------------------------------------------------------
  340.   # * Public Instance Variables
  341.   #--------------------------------------------------------------------------
  342.   attr_accessor   :pending_index            # Pending position (for formation)
  343.   attr_accessor   :pending                  # Pending
  344.   #--------------------------------------------------------------------------
  345.   # * Object Initialization
  346.   #--------------------------------------------------------------------------
  347.   def initialize
  348.     super(0, 0, 544, 416)
  349.     self.hide
  350.     @mode = :wait
  351.     @pending_index = -1
  352.     @pending = false
  353.     refresh
  354.   end
  355.   #--------------------------------------------------------------------------
  356.   # * Refresh
  357.   #--------------------------------------------------------------------------
  358.   def refresh   
  359.     super
  360.     rect = Rect.new(0, 196, self.contents.width, line_height)
  361.     draw_text(rect, $game_party.members[index].name, 1)
  362.   end
  363.   #--------------------------------------------------------------------------
  364.   # * Get Number of Items
  365.   #--------------------------------------------------------------------------
  366.   def item_max
  367.     $game_party.members.size
  368.   end
  369.   #--------------------------------------------------------------------------
  370.   # * Refresh Movement Period
  371.   #--------------------------------------------------------------------------
  372.   def refresh_move( mode )
  373.     unless pending_index >= 0
  374.       super
  375.     else
  376.       d = 2.0 * Math::PI / item_max
  377.       for i in 0...item_max
  378.         j = i - pending_index
  379.         x = @cx + ( RING_R * Math.sin( d * j) ).to_i
  380.         y = @cy - ( RING_R * Math.cos( d * j) ).to_i
  381.         draw_item(x, y, i)
  382.       end
  383.       @mode = :wait
  384.     end
  385.   end
  386.   #--------------------------------------------------------------------------
  387.   # * Draw Item
  388.   #     x     : draw spot x-coordinate
  389.   #     y     : draw spot y-coordinate
  390.   #     index : item number
  391.   #--------------------------------------------------------------------------
  392.   def draw_item(x, y, i)
  393.     if i == index && !(@pending && @pending_index < 0)
  394.       draw_character($game_party.members[i].character_name,
  395.       $game_party.members[i].character_index , x, y, true, true)
  396.     else
  397.       draw_character($game_party.members[i].character_name,
  398.       $game_party.members[i].character_index , x, y, false, true)
  399.     end
  400.   end
  401.   #--------------------------------------------------------------------------
  402.   # * Processing When OK Button Is Pressed
  403.   #--------------------------------------------------------------------------
  404.   def process_ok
  405.     super
  406.     $game_party.menu_actor = $game_party.members[index] unless pending
  407.   end
  408.   #--------------------------------------------------------------------------
  409.   # * Restore Previous Selection Position
  410.   #--------------------------------------------------------------------------
  411.   def select_last
  412.     select($game_party.members.index($game_party.menu_actor) || 0)
  413.     refresh
  414.   end
  415. end

  416. #==============================================================================
  417. # ** Scene_Menu
  418. #==============================================================================

  419. class Scene_Menu < Scene_MenuBase
  420.   #--------------------------------------------------------------------------
  421.   # * Alias Listings
  422.   #--------------------------------------------------------------------------  
  423.   alias start_ring_original start
  424.   alias create_command_window_ring_menu_original create_command_window
  425.   alias command_personal_ring_original command_personal
  426.   alias command_formation_ring_original command_formation
  427.   alias on_personal_cancel_ring_original on_personal_cancel
  428.   #--------------------------------------------------------------------------
  429.   # * Start Processing
  430.   #--------------------------------------------------------------------------
  431.   def start
  432.     start_ring_original
  433.     create_location_window
  434.   end
  435.   #--------------------------------------------------------------------------
  436.   # * Create Location Window
  437.   #--------------------------------------------------------------------------
  438.   def create_location_window
  439.     @location_window = Window_location.new(0, 0)
  440.   end
  441.   #--------------------------------------------------------------------------
  442.   # * Create Command Window
  443.   #--------------------------------------------------------------------------
  444.   def create_command_window
  445.     create_command_window_ring_menu_original
  446.     @command_window.set_handler(:load,      method(:command_load))
  447.   end
  448.   #--------------------------------------------------------------------------
  449.   # * Create Status Window
  450.   #--------------------------------------------------------------------------
  451.   def create_status_window
  452.     @status_window = Window_RingStatus.new
  453.   end
  454.   #--------------------------------------------------------------------------
  455.   # * [Skill], [Equipment] and [Status] Commands
  456.   #--------------------------------------------------------------------------
  457.   def command_personal
  458.     if $game_party.members.size < 2 && ACTOR_SKIP
  459.       on_personal_ok
  460.     else
  461.       @command_window.hide
  462.       @status_window.show
  463.       command_personal_ring_original
  464.     end
  465.   end
  466.   #--------------------------------------------------------------------------
  467.   # * [Formation] Command
  468.   #--------------------------------------------------------------------------
  469.   def command_formation
  470.     @status_window.pending = true
  471.     @command_window.hide
  472.     command_formation_ring_original
  473.     @status_window.index = 0
  474.     @status_window.refresh
  475.     @status_window.show
  476.   end
  477.   #--------------------------------------------------------------------------
  478.   # * [Load] Command
  479.   #--------------------------------------------------------------------------
  480.   def command_load
  481.     SceneManager.call(Scene_Load)
  482.   end
  483.   #--------------------------------------------------------------------------
  484.   # * [Cancel] Personal Command
  485.   #--------------------------------------------------------------------------
  486.   def on_personal_cancel
  487.     @status_window.hide
  488.     on_personal_cancel_ring_original
  489.     @status_window.deactivate
  490.     @command_window.show
  491.   end
  492.   #--------------------------------------------------------------------------
  493.   # * Formation [OK]
  494.   #--------------------------------------------------------------------------
  495.   def on_formation_ok
  496.     if @status_window.pending_index >= 0
  497.       $game_party.swap_order(@status_window.index,
  498.                              @status_window.pending_index)
  499.       @status_window.index = @status_window.pending_index
  500.       @status_window.pending_index = -1
  501.     else
  502.       @status_window.pending_index = @status_window.index
  503.     end
  504.     @status_window.refresh
  505.     @status_window.activate
  506.   end
  507.   #--------------------------------------------------------------------------
  508.   # * Formation [Cancel]
  509.   #--------------------------------------------------------------------------
  510.   def on_formation_cancel
  511.     if @status_window.pending_index >= 0
  512.       @status_window.index = @status_window.pending_index
  513.       @status_window.pending_index = -1
  514.       @status_window.activate
  515.       @status_window.refresh
  516.     else
  517.       @status_window.pending = false
  518.       @status_window.hide
  519.       @status_window.select_last
  520.       @status_window.deactivate
  521.       @command_window.show
  522.       @command_window.activate
  523.     end
  524.   end
  525. end

  526. #==============================================================================
  527. # ** Window_Base
  528. #------------------------------------------------------------------------------
  529. #  Edited to allow disabled character icons and y centring
  530. #==============================================================================

  531. class Window_Base < Window
  532.   #--------------------------------------------------------------------------
  533.   # * Draw Character Graphic
  534.   #--------------------------------------------------------------------------
  535.   def draw_character(character_name, character_index, x, y, enabled = true, centred = false)
  536.     return if character_name == nil
  537.     bitmap = Cache.character(character_name)
  538.     sign = character_name[/^[\!\$]./]
  539.     if sign && sign.include?(')
  540.       cw = bitmap.width / 3
  541.       ch = bitmap.height / 4
  542.     else
  543.       cw = bitmap.width / 12
  544.       ch = bitmap.height / 8
  545.     end
  546.     n = character_index
  547.     src_rect = Rect.new((n%4*3+1)*cw, (n/4*4)*ch, cw, ch)
  548.     self.contents.blt(x - cw / 2, centred ? y - ch/2 : y - ch, bitmap, src_rect,
  549.     enabled ? 255 : 128)
  550.   end
  551. end

  552. #==============================================================================
  553. # ** Window_Location
  554. #------------------------------------------------------------------------------
  555. #  This class shows the current map name.
  556. #==============================================================================

  557. class Window_location < Window_Base
  558.   #--------------------------------------------------------------------------
  559.   # * Object Initialization
  560.   #--------------------------------------------------------------------------
  561.   def initialize(x, y)
  562.     super(x, y, 160, (line_height*2) + 32)
  563.     refresh
  564.   end
  565.   #--------------------------------------------------------------------------
  566.   # * Refresh
  567.   #--------------------------------------------------------------------------
  568.   def refresh
  569.     contents.clear
  570.     @map = load_data(sprintf("Data/Map%03d.rvdata2", $game_map.map_id))
  571.     change_color(system_color)
  572.     draw_text(4, 0, 128, line_height, "Location :")
  573.     change_color(normal_color)
  574.     draw_text(0, line_height, 128, line_height, @map.display_name, 1)
  575.   end
  576. end
复制代码

评分

参与人数 1星屑 +80 收起 理由
Sion + 80 感谢帮忙

查看全部评分


回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-12-18 22:01

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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