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

Project1

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

新的 RMXP 用 WINDOW 类

 关闭 [复制链接]

Lv4.逐梦者

梦石
0
星屑
11986
在线时间
999 小时
注册时间
2007-12-15
帖子
188
跳转到指定楼层
1
发表于 2008-9-2 00:53:50 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
几个月前写的一个脚本,与原版相比增强了部分功能,整合了动态光标(可以同时使用多种),使用了 猫哥哥 的 Bitmap 模糊化脚本。

主脚本:
  1. #==============================================================================
  2. # ■ Class_WindowSZ
  3. #------------------------------------------------------------------------------
  4. #  新的游戏内窗口的类。      By 洛克人SZ
  5. #==============================================================================
  6. class WindowSZ < Object
  7.   #--------------------------------------------------------------------------
  8.   # ● 定义常量
  9.   #--------------------------------------------------------------------------
  10.   BK_SIZE = 16                         # 边框宽度(单位:像素)
  11.   #--------------------------------------------------------------------------
  12.   # ● 定义实例变量
  13.   #--------------------------------------------------------------------------
  14.   attr_accessor :cursor_rect           # 光标的矩形
  15.   attr_accessor :cursor_a              # 动态光标 类型 A
  16.   attr_accessor :cursor_a_s            # 动态光标 类型 A 静态
  17.   attr_accessor :cursor_b              # 动态光标 类型 B
  18.   attr_accessor :arrow_cr_id_max       # 箭头 ID 最大数
  19.   attr_accessor :arrow_cr_id           # 箭头 ID
  20.   #--------------------------------------------------------------------------
  21.   # ● 初始化对像
  22.   #--------------------------------------------------------------------------
  23.   def initialize(viewport = Viewport.new(0,0,64,64))
  24.     @viewportsz = viewport
  25.     @viewportcr = Viewport.new(0,0,64,64)
  26.     @self_wz = self.get_viewport_rect
  27.     @rect = Array.new(7)
  28.     @rect[0] = Rect.new(128, 0, BK_SIZE, BK_SIZE)
  29.     @rect[1] = Rect.new(128, 64 - BK_SIZE, BK_SIZE, BK_SIZE)
  30.     @rect[2] = Rect.new(192 - BK_SIZE, 0, BK_SIZE, BK_SIZE)
  31.     @rect[3] = Rect.new(192 - BK_SIZE, 64 - BK_SIZE, BK_SIZE, BK_SIZE)
  32.     @psize = [64, 64]
  33.     @stretchsz = true
  34.     @activesz = true
  35.     @visiblesz = true
  36.     @pausesz = false
  37.     @opacitysz = 255
  38.     @windowbg = Sprite.new
  39.     @windowbk = Sprite.new
  40.     @windownr = nil
  41.     @windowskin = Bitmap.new(192, 128)
  42.     @cursor_rect = Sprite_Cursor_Rect.new(@viewportsz)
  43.     @cursor_rect.empty
  44.     @pausecr = Sprite_Pause_Cursor.new(@viewportcr)
  45.     @arrowcr = []
  46.     @arrowcrp = []
  47.     for i in 0..3
  48.       @arrowcr.push(Sprite_Arrow_Cursor.new(@viewportcr, i))
  49.       @arrowcrp.push(false)
  50.     end
  51.     @arrow_cr_id_max = 1
  52.     @arrow_cr_id = 0
  53.     self.set_name
  54.     self.set_self_wz
  55.     self.set_window(@self_wz.width, @self_wz.height)
  56.     @disposedsz = false
  57.     #GC.start
  58.   end
  59.   def set_window(widthcc, heightcc)
  60.     unless widthcc == @psize[0] and heightcc == @psize[1]
  61.       tdata1 = [BK_SIZE, BK_SIZE * 2,
  62.           widthcc - 4, heightcc - 4, heightcc - @rect[1].height,
  63.           widthcc - @rect[2].width, widthcc - @rect[3].width,
  64.           heightcc - @rect[3].height]
  65.       #bitmapcc = Bitmap.new(widthcc, heightcc)
  66.       @windowbg.bitmap.dispose if @windowbg.bitmap != nil
  67.       #@windowbg.bitmap.clear
  68.       @windowbg.bitmap = nil
  69.       @windowbg.bitmap = Bitmap.new(widthcc, heightcc)
  70.       if @stretchsz
  71.         rectcc = nil
  72.         rectcc = Rect.new(2, 2, tdata1[2], tdata1[3])
  73.         @rect[4] = Rect.new(2, 2, 124, 124)
  74.         @windowbg.bitmap.stretch_blt(rectcc,@windowskin,@rect[4])
  75.         rectcc = nil
  76.       else
  77.         if widthcc <= 124 and heightcc <= 124
  78.           @rect[4] = Rect.new(2, 2, tdata1[2], tdata1[3])
  79.           @windowbg.bitmap.blt(2,2,@windowskin,@rect[4])
  80.         elsif widthcc > 124 and heightcc > 124
  81.           @rect[4] = Rect.new(2, 2, 124, 124)
  82.           cntt = [widthcc / 124, widthcc % 124, heightcc / 124, heightcc % 124]
  83.           for i in 0...cntt[2]
  84.             @rect[4].width = 124
  85.             for l in 0...cntt[0]
  86.               @windowbg.bitmap.blt(2+l*124,2+i*124,@windowskin,@rect[4])
  87.             end
  88.             @rect[4].width = cntt[1]
  89.             @windowbg.bitmap.blt(2+l*124+124,2+i*124,@windowskin,@rect[4])
  90.           end
  91.           @rect[4].width, @rect[4].height = 124, cntt[3]
  92.           for l in 0...cntt[0]
  93.             @windowbg.bitmap.blt(2+l*124,2+i*124+124,@windowskin,@rect[4])
  94.           end
  95.           @rect[4].width = cntt[1]
  96.           @windowbg.bitmap.blt(2+l*124+124,2+i*124+124,@windowskin,@rect[4])
  97.         elsif widthcc > 124 and heightcc <= 124
  98.           @rect[4] = Rect.new(2, 2, 124, tdata1[3])
  99.           cntt = [widthcc / 124, widthcc % 124, tdata1[3]]
  100.           for i in 0...cntt[0]
  101.             @windowbg.bitmap.blt(2+i*124,2,@windowskin,@rect[4])
  102.           end
  103.           @rect[4].width = cntt[1]
  104.           @windowbg.bitmap.blt(2+i*124+124,2,@windowskin,@rect[4])
  105.         elsif widthcc <= 124 and heightcc > 124
  106.           @rect[4] = Rect.new(2, 2, tdata1[2], 124)
  107.           cntt = [heightcc / 124, heightcc % 124, tdata1[2]]
  108.           for i in 0...cntt[0]
  109.             @windowbg.bitmap.blt(2,2+i*124,@windowskin,@rect[4])
  110.           end
  111.           @rect[4].height = cntt[1]
  112.           @windowbg.bitmap.blt(2,2+i*124+124,@windowskin,@rect[4])
  113.         end
  114.       end
  115.       @windowbg.bitmap.blur
  116.       #bitmapcc.dispose
  117.       #bitmapcc = nil
  118.       @windowbk.bitmap.dispose if @windowbk.bitmap != nil
  119.       #@windowbk.bitmap.clear
  120.       @windowbk.bitmap = nil
  121.       @windowbk.bitmap = Bitmap.new(widthcc, heightcc)
  122.       #bitmapcc = Bitmap.new(widthcc, heightcc)
  123. #      @windowbk.bitmap.stretch_blt(Rect.new(0,0,widthcc,heightcc),@windowskin,Rect.new(128,0,64,64))
  124.       @windowbk.bitmap.blt(0, 0, @windowskin, @rect[0])
  125.       @windowbk.bitmap.blt(0, tdata1[4], @windowskin, @rect[1])
  126.       @windowbk.bitmap.blt(tdata1[5], 0, @windowskin, @rect[2])
  127.       @windowbk.bitmap.blt(tdata1[6], tdata1[7],@windowskin, @rect[3])
  128.       tdata2 = [widthcc - tdata1[1], 64 - tdata1[1],
  129.           heightcc - tdata1[1]]
  130.       if tdata2[0] <= tdata2[1]
  131.         @rect[5] = [0, @rect[0].dup]
  132.         @rect[5][1].width = tdata2[0]
  133.         @rect[5][1].x, @rect[5][1].y = 128 + tdata1[0], 0
  134.       else
  135.         @rect[5] = [1, tdata2[0] / tdata2[1], tdata2[0] % tdata2[1], 128 + tdata1[0], 0, 64 - tdata1[0]]
  136.       end
  137.       if @rect[5][0] == 1
  138.         for i in 0...@rect[5][1]
  139.           @windowbk.bitmap.blt(tdata1[0] + i * tdata2[1], 0, @windowskin, Rect.new(@rect[5][3], @rect[5][4], 64 - tdata1[1], tdata1[0]))
  140.           @windowbk.bitmap.blt(tdata1[0] + i * tdata2[1], tdata1[4], @windowskin, Rect.new(@rect[5][3], @rect[5][5], 64 - tdata1[1], tdata1[0]))
  141.         end
  142.         wht = (tdata1[0] + i * tdata2[1]) + tdata2[1]
  143.         @windowbk.bitmap.blt(wht, 0, @windowskin, Rect.new(@rect[5][3], @rect[5][4], @rect[5][2], tdata1[0]))
  144.         @windowbk.bitmap.blt(wht, tdata1[4], @windowskin, Rect.new(@rect[5][3], @rect[5][5], @rect[5][2], tdata1[0]))
  145.         wht = nil
  146.       else
  147.         @windowbk.bitmap.blt(tdata1[0], 0, @windowskin, @rect[5][1])
  148.         @rect[5][1].y = 64 - tdata1[0]
  149.         @windowbk.bitmap.blt(tdata1[0], tdata1[4], @windowskin, @rect[5][1])
  150.       end
  151.       if tdata2[2] <= tdata2[1]
  152.         @rect[6] = [0, @rect[0].dup]
  153.         @rect[6][1].height = tdata2[2]
  154.         @rect[6][1].x, @rect[6][1].y = 128, tdata1[0]
  155.       else
  156.         @rect[6] = [1, tdata2[2] / tdata2[1], tdata2[2] % tdata2[1], 128, 64 - tdata1[0], 192 - tdata1[0]]
  157.       end
  158.       if @rect[6][0] == 1
  159.         for i in 0...@rect[6][1]
  160.           @windowbk.bitmap.blt(0, tdata1[0] + i * tdata2[1], @windowskin, Rect.new(@rect[6][3], tdata1[0], tdata1[0], 64 - tdata1[1]))
  161.           @windowbk.bitmap.blt(tdata1[5], tdata1[0] + i * tdata2[1], @windowskin, Rect.new(@rect[6][5], tdata1[0], tdata1[0], 64 - tdata1[1]))
  162.         end
  163.         wht = (tdata1[0] + i * tdata2[1]) + tdata2[1]
  164.         @windowbk.bitmap.blt(0, wht, @windowskin, Rect.new(@rect[6][3], tdata1[0], tdata1[0], @rect[6][2]))
  165.         @windowbk.bitmap.blt(tdata1[5], wht, @windowskin, Rect.new(@rect[6][5], tdata1[0], tdata1[0], @rect[6][2]))
  166.         wht = nil
  167.       else
  168.         @windowbk.bitmap.blt(0, tdata1[0], @windowskin, @rect[6][1])
  169.         @rect[6][1].x = 192 - tdata1[0]
  170.         @windowbk.bitmap.blt(tdata1[5], tdata1[0], @windowskin, @rect[6][1])
  171.       end
  172.       self.set_name(@selfname[0], @selfname[1], @selfname[2], @selfname[3], @selfname[4])
  173.       @windowbk.z = @windowbg.z + 1
  174.       #bitmapcc.dispose# = nil
  175.       #bitmapcc = nil
  176.       tdata1, tdata2, @rect[5], @rect[6] = nil, nil, nil, nil
  177.       self.set_self_wz
  178.       @psize = [widthcc, heightcc]
  179.     end
  180.   end
  181.   def get_viewport_rect
  182.     rectfw1 = [@viewportsz.rect.x, @viewportsz.rect.y]
  183.     rectfw2 = [@viewportsz.rect.width, @viewportsz.rect.height]
  184.     rect = Rect.new(rectfw1[0], rectfw1[1], rectfw2[0], rectfw2[1])
  185.     return rect
  186.   end
  187.   def windowskin
  188.     return @windowskin
  189.   end
  190.   def windowskin=(windowskin)
  191.     @windowskin = windowskin
  192.     self.set_window(@self_wz.width, @self_wz.height)
  193.     @cursor_rect.windowskin = @windowskin if @cursor_rect != nil
  194.     @pausecr.windowskin = @windowskin
  195.     for i in 0..3
  196.       @arrowcr[i].windowskin = @windowskin
  197.     end
  198.   end
  199.   def set_self_wz
  200.     @windowbk.x = @self_wz.x
  201.     @windowbk.y = @self_wz.y
  202.     @windowbg.x = @self_wz.x
  203.     @windowbg.y = @self_wz.y
  204.     @viewportsz.rect.x = @self_wz.x + BK_SIZE
  205.     @viewportsz.rect.y = @self_wz.y + BK_SIZE
  206.     @viewportsz.rect.width = @self_wz.width - (BK_SIZE * 2)
  207.     @viewportsz.rect.height = @self_wz.height - (BK_SIZE * 2)
  208.     @viewportcr.rect.x = @self_wz.x
  209.     @viewportcr.rect.y = @self_wz.y
  210.     @viewportcr.rect.width = @self_wz.width
  211.     @viewportcr.rect.height = @self_wz.height
  212.     @pausecr.x = (@self_wz.width - 16) / 2
  213.     @pausecr.y = @self_wz.height - 16
  214.     self.set_arrow_wz
  215.   end
  216.   def set_arrow_wz
  217.     @arrowcr[0].x, @arrowcr[0].y = @self_wz.width - BK_SIZE, BK_SIZE + ((@self_wz.height - BK_SIZE * 2) / @arrow_cr_id_max * @arrow_cr_id)
  218.     @arrowcr[1].x, @arrowcr[1].y = @self_wz.width - BK_SIZE, BK_SIZE + ((@self_wz.height - BK_SIZE * 2) / @arrow_cr_id_max * @arrow_cr_id) + 10
  219.     @arrowcr[2].x, @arrowcr[2].y = BK_SIZE + ((@self_wz.height - BK_SIZE * 2) / @arrow_cr_id_max * @arrow_cr_id), @self_wz.height - BK_SIZE
  220.     @arrowcr[3].x, @arrowcr[3].y = BK_SIZE + ((@self_wz.height - BK_SIZE * 2) / @arrow_cr_id_max * @arrow_cr_id) + 10, @self_wz.height - BK_SIZE
  221.   end
  222.   def x
  223.     return @self_wz.x
  224.   end
  225.   def y
  226.     return @self_wz.y
  227.   end
  228.   def width
  229.     return @self_wz.width
  230.   end
  231.   def height
  232.     return @self_wz.height
  233.   end
  234.   def x=(x)
  235.     @self_wz.x = x
  236.     self.set_self_wz
  237.   end
  238.   def y=(y)
  239.     @self_wz.y = y
  240.     self.set_self_wz
  241.   end
  242.   def width=(width)
  243.     @self_wz.width = width
  244.     self.set_self_wz
  245.     self.set_window(@self_wz.width, @self_wz.height)
  246.   end
  247.   def height=(height)
  248.     @self_wz.height = height
  249.     self.set_self_wz
  250.     self.set_window(@self_wz.width, @self_wz.height)
  251.   end
  252.   def contents
  253.     return @windownr.bitmap if @windownr != nil
  254.   end
  255.   def contents=(contents)
  256.     @windownr = Sprite.new(@viewportsz) if @windownr == nil
  257.     @windownr.bitmap = contents
  258.   end
  259.   def stretch
  260.     return @stretchsz
  261.   end
  262.   def stretch=(stretch_type)
  263.     @stretchsz = stretch_type if stretch_type.is_a?(TrueClass)
  264.     @stretchsz = stretch_type if stretch_type.is_a?(FalseClass)
  265.     self.set_window(@self_wz.width, @self_wz.height)
  266.   end
  267.   def active
  268.     return @activesz
  269.   end
  270.   def active=(active)
  271.     @activesz = active if active.is_a?(TrueClass)
  272.     @activesz = active if active.is_a?(FalseClass)
  273.   end
  274.   def visible
  275.     return @visiblesz
  276.   end
  277.   def visible=(visible)
  278.     @visiblesz = visible if visible.is_a?(TrueClass)
  279.     @visiblesz = visible if visible.is_a?(FalseClass)
  280.     @windowbk.visible = @visiblesz
  281.     @windowbg.visible = @visiblesz
  282.     @viewportsz.visible = @visiblesz
  283.     @viewportcr.visible = @visiblesz
  284.     #@cursor_rect.visible = @visiblesz if @cursor_rect != nil
  285.     #@cursor_a.visible = @visiblesz if @cursor_a != nil
  286.     #@cursor_a_s.visible = @visiblesz if @cursor_a_s != nil
  287.     #@cursor_b.visible = @visiblesz if @cursor_b != nil
  288.   end
  289.   def pause
  290.     return @pausesz
  291.   end
  292.   def pause=(pause)
  293.     @pausesz = pause if pause.is_a?(TrueClass)
  294.     @pausesz = pause if pause.is_a?(FalseClass)
  295.   end
  296.   def z
  297.     return @windowbk.z
  298.   end
  299.   def z=(z)
  300.     @windowbk.z = z# - 1
  301.     @windowbg.z = z# - 1
  302.     @viewportsz.z = z + 100
  303.     @viewportcr.z = z + 100
  304.     #@cursor_rect.z = z - 100 if @cursor_rect != nil
  305.     #@cursor_a.z = z - 100 if @cursor_a != nil
  306.     #@cursor_a_s.z = z - 100 if @cursor_a_s != nil
  307.     #@cursor_b.z = z - 100 if @cursor_b != nil
  308.   end
  309.   def ox
  310.     return @viewportsz.ox
  311.   end
  312.   def ox=(ox)
  313.     @viewportsz.ox = ox
  314.   end
  315.   def oy
  316.     return @viewportsz.oy
  317.   end
  318.   def oy=(oy)
  319.     @viewportsz.oy = oy
  320.   end
  321.   def opacity
  322.     return @opacitysz
  323.   end
  324.   def opacity=(opacity)
  325.     opacity = 0 if opacity < 0
  326.     opacity = 255 if opacity > 255
  327.     @opacitysz = opacity
  328.     @windowbk.opacity = @opacitysz
  329.     @windowbg.opacity = @opacitysz
  330.   end
  331.   def back_opacity
  332.     return @windowbg.opacity
  333.   end
  334.   def back_opacity=(opacity)
  335.     opacity = 0 if opacity < 0
  336.     opacity = 255 if opacity > 255
  337.     @windowbg.opacity = opacity
  338.   end
  339.   def contents_opacity
  340.     return @windownr.opacity if @windownr != nil
  341.   end
  342.   def contents_opacity=(opacity)
  343.     opacity = 0 if opacity < 0
  344.     opacity = 255 if opacity > 255
  345.     @windownr.opacity = opacity if @windownr != nil
  346.     @cursor_rect.opacity = opacity if @cursor_rect != nil
  347.     @cursor_a.opacity = opacity if @cursor_a != nil
  348.     @cursor_a_s.opacity = opacity if @cursor_a_s != nil
  349.     @cursor_b.opacity = opacity if @cursor_b != nil
  350.   end
  351.   def viewport
  352.     return @viewportsz
  353.   end
  354.   def dispose
  355.     @viewportsz.dispose
  356.     @viewportcr.dispose
  357.     @windowbk.bitmap.dispose if @windowbk.bitmap != nil
  358.     @windowbk.dispose
  359.     @windowbg.bitmap.dispose if @windowbg.bitmap != nil
  360.     @windowbg.dispose
  361.     @windownr.bitmap.dispose if @windownr != nil and @windownr.bitmap != nil
  362.     @windownr.dispose if @windownr != nil
  363.     @cursor_rect.dispose if @cursor_rect != nil
  364.     @cursor_a.dispose if @cursor_a != nil
  365.     @cursor_a_s.dispose if @cursor_a_s != nil
  366.     @cursor_b.dispose if @cursor_b != nil
  367.     @pausecr.dispose
  368.     for i in 0..3
  369.       @arrowcr[i].dispose
  370.       @arrowcr[i] = nil
  371.     end
  372.     @viewportsz = nil
  373.     @viewportcr = nil
  374.     @windowbk = nil
  375.     @windowbg = nil
  376.     @windownr = nil
  377.     @cursor_rect = nil
  378.     @cursor_a = nil
  379.     @cursor_a_s = nil
  380.     @cursor_b = nil
  381.     @pausecr = nil
  382.     @disposedsz = true
  383.     GC.start
  384.   end
  385.   def disposed?
  386.     return @disposedsz
  387.   end
  388.   def set_cursor_rect(on_off)
  389.     @cursor_rect = Sprite_Cursor_Rect.new(@viewportsz) if on_off.is_a?(TrueClass) and @cursor_rect == nil
  390.     @cursor_rect.dispose if on_off.is_a?(FalseClass)
  391.     @cursor_rect = nil if on_off.is_a?(FalseClass)
  392.   end
  393.   def set_cursor_a(on_off)
  394.     @cursor_a = Sprite_CursorA.new(@viewportcr) if on_off.is_a?(TrueClass) and @cursor_a == nil
  395.     @cursor_a.dispose if on_off.is_a?(FalseClass)
  396.     @cursor_a = nil if on_off.is_a?(FalseClass)
  397.   end
  398.   def set_cursor_a_s(on_off)
  399.     @cursor_a_s = Sprite_CursorA_S.new(@viewportcr) if on_off.is_a?(TrueClass) and @cursor_a_s == nil
  400.     @cursor_a_s.dispose if on_off.is_a?(FalseClass)
  401.     @cursor_a_s = nil if on_off.is_a?(FalseClass)
  402.   end
  403.   def set_cursor_b(on_off)
  404.     @cursor_b = Sprite_CursorB.new(@viewportcr) if on_off.is_a?(TrueClass) and @cursor_b == nil
  405.     @cursor_b.dispose if on_off.is_a?(FalseClass)
  406.     @cursor_b = nil if on_off.is_a?(FalseClass)
  407.   end
  408.   def set_name(namesz = "", wz1 = 0, wz2 = BK_SIZE, font = Font.new, align = 0)
  409.     @selfname = [namesz, wz1, wz2, font, align]
  410.     if namesz != ""
  411.       @selfname = [namesz, wz1, wz2, font, align]
  412.       @selfname[1] = 0 if wz1 == 0
  413.       @selfname[1] = self.height - font.size - 2 if wz1 == 1
  414.       @windowbk.bitmap.font = @selfname[3]
  415.       tsize = @windowbk.bitmap.text_size(@selfname[0]).width
  416.       @windowbk.bitmap.draw_text(@selfname[2],@selfname[1],tsize,@selfname[3].size,@selfname[0],@selfname[4])
  417.     end
  418.   end
  419.   def update
  420.     @cursor_rect.visible = true if @cursor_rect != nil and self.visible and self.active
  421.     @cursor_rect.update if @cursor_rect != nil and @cursor_rect.visible and self.active
  422.     #@cursor_a.visible = true if @cursor_a != nil and self.visible and self.active
  423.     @cursor_a.update if @cursor_a != nil and @cursor_a.visible and self.active
  424.     #@cursor_b.visible = true if @cursor_b != nil and self.visible and self.active
  425.     @cursor_b.update if @cursor_b != nil and @cursor_b.visible and self.active
  426.     @pausecr.visible = @pausesz
  427.     @pausecr.update if @pausecr.visible
  428.     if @windownr != nil and @windownr.bitmap != nil and self.active and @windownr.bitmap.height > self.height - BK_SIZE * 2 and self.oy > 0
  429.       @arrowcr[0].opacity, @arrowcr[0].count, @arrowcr[0].wait_count = @arrowcr[1].opacity, @arrowcr[1].count, @arrowcr[1].wait_count if @arrowcrp[0] == false
  430.       @arrowcrp[0] = true if @arrowcr[0].visible == false
  431.       @arrowcr[0].visible = true if @arrowcr[0].visible == false
  432.     else
  433.       @arrowcrp[0] = false if @arrowcr[0].visible == true
  434.       @arrowcr[0].visible = false if @arrowcr[0].visible == true
  435.     end
  436.     if @windownr != nil and @windownr.bitmap != nil and self.active and @windownr.bitmap.height > self.height - BK_SIZE * 2 and self.oy < @windownr.bitmap.height - (self.height - BK_SIZE * 2)
  437.       @arrowcr[1].opacity, @arrowcr[1].count, @arrowcr[1].wait_count = @arrowcr[0].opacity, @arrowcr[0].count, @arrowcr[0].wait_count if @arrowcrp[1] == false
  438.       @arrowcrp[1] = true if @arrowcr[1].visible == false
  439.       @arrowcr[1].visible = true if @arrowcr[1].visible == false
  440.     else
  441.       @arrowcrp[1] = false if @arrowcr[1].visible == true
  442.       @arrowcr[1].visible = false if @arrowcr[1].visible == true
  443.     end
  444.     if @windownr != nil and @windownr.bitmap != nil and self.active and @windownr.bitmap.width > self.width - BK_SIZE * 2 and self.ox > 0
  445.       @arrowcr[2].opacity, @arrowcr[2].count, @arrowcr[2].wait_count = @arrowcr[3].opacity, @arrowcr[3].count, @arrowcr[3].wait_count if @arrowcrp[2] == false
  446.       @arrowcrp[2] = true if @arrowcr[2].visible == false
  447.       @arrowcr[2].visible = true if @arrowcr[2].visible == false
  448.     else
  449.       @arrowcrp[2] = false if @arrowcr[2].visible == true
  450.       @arrowcr[2].visible = false if @arrowcr[2].visible == true
  451.     end
  452.     if @windownr != nil and @windownr.bitmap != nil and self.active and @windownr.bitmap.width > self.width - BK_SIZE * 2 and self.ox < @windownr.bitmap.width - (self.width - BK_SIZE * 2)
  453.       @arrowcr[3].opacity, @arrowcr[3].count, @arrowcr[3].wait_count = @arrowcr[2].opacity, @arrowcr[2].count, @arrowcr[2].wait_count if @arrowcrp[3] == false
  454.       @arrowcrp[3] = true if @arrowcr[3].visible == false
  455.       @arrowcr[3].visible = true if @arrowcr[3].visible == false
  456.     else
  457.       @arrowcrp[3] = false if @arrowcr[3].visible == true
  458.       @arrowcr[3].visible = false if @arrowcr[3].visible == true
  459.     end
  460.     @arrowcr[0].update if @arrowcr[0].visible
  461.     @arrowcr[1].update if @arrowcr[1].visible
  462.     @arrowcr[2].update if @arrowcr[2].visible
  463.     @arrowcr[3].update if @arrowcr[3].visible
  464.   end
  465. end
复制代码


辅助脚本:
  1. #==============================================================================
  2. # □ Sprite_Cursor
  3. #==============================================================================
  4. class Sprite_CursorA < Sprite
  5.   def initialize(viewport)
  6.     super(viewport)
  7.     self.bitmap = RPG::Cache.windowskin("cursor.png")
  8.     self.visible = false
  9.     @count = 0
  10.     @wait_count = 0
  11.     update
  12.   end
  13.   #--------------------------------------------------------------------------
  14.   # ● 更新画面
  15.   #--------------------------------------------------------------------------
  16.   def update
  17.     if @wait_count == 0
  18.       @count = 0
  19.     elsif @wait_count == 8
  20.       @count = 1
  21.     end
  22.     if @count == 0
  23.       self.ox += 1
  24.       @wait_count += 1
  25.     elsif @count == 1
  26.       self.ox -= 1
  27.       @wait_count -= 1
  28.     end
  29.   end
  30.   #--------------------------------------------------------------------------
  31.   # ● 半透明化
  32.   #--------------------------------------------------------------------------
  33.   def opacitysz(type)
  34.     if type == 0
  35.       self.opacity -= 8 if self.opacity > 180
  36.     else
  37.       self.opacity += 8 if self.opacity < 255
  38.     end
  39.   end
  40.   #--------------------------------------------------------------------------
  41.   # ● 释放
  42.   #--------------------------------------------------------------------------
  43.   def dispose
  44.     if self.bitmap != nil
  45.       self.bitmap.dispose
  46.     end
  47.     super
  48.   end
  49. end
复制代码
  1. #==============================================================================
  2. # □ Sprite_CursorA
  3. #==============================================================================
  4. class Sprite_CursorA_S < Sprite
  5.   def initialize(viewport)
  6.     super(viewport)
  7.     self.bitmap = RPG::Cache.windowskin("cursor.png")
  8.     self.visible = false
  9.     @count = 0
  10.     @wait_count = 0
  11.   end
  12.   #--------------------------------------------------------------------------
  13.   # ● 半透明化
  14.   #--------------------------------------------------------------------------
  15.   def opacitysz(type)
  16.     if type == 0
  17.       self.opacity -= 8 if self.opacity > 180
  18.     else
  19.       self.opacity += 8 if self.opacity < 255
  20.     end
  21.   end
  22.   #--------------------------------------------------------------------------
  23.   # ● 释放
  24.   #--------------------------------------------------------------------------
  25.   def dispose
  26.     if self.bitmap != nil
  27.       self.bitmap.dispose
  28.     end
  29.     super
  30.   end
  31. end
复制代码
  1. #==============================================================================
  2. # □ Sprite_Cursor
  3. #==============================================================================
  4. class Sprite_CursorB < Sprite
  5.   def initialize(viewport)
  6.     super(viewport)
  7.     @bitmap = RPG::Cache.windowskin("cursora.png")
  8.     self.visible = false
  9.     @count = @count1 = @wait_count = @wait_count1 = 0
  10.     @tp = false
  11.     @ct = false
  12.     @rect = Array.new(5)
  13.     @rect[0] = Rect.new(0, 0, 12, 12)
  14.     @rect[1] = Rect.new(0, 20, 12, 12)
  15.     @rect[2] = Rect.new(20, 0, 12, 12)
  16.     @rect[3] = Rect.new(20, 20, 12, 12)
  17.     @utype = 0
  18.     self.set(32, 32)
  19.     update
  20.   end
  21.   #--------------------------------------------------------------------------
  22.   # ● 更新画面
  23.   #--------------------------------------------------------------------------
  24.   def update
  25.     update_type(@utype)
  26.   end
  27.   #--------------------------------------------------------------------------
  28.   # ● 设置尺寸
  29.   #--------------------------------------------------------------------------
  30.   def set(width, height)
  31.     width = 24 if width < 24
  32.     height = 24 if height < 24
  33.     @bitmapa.dispose if @bitmapa != nil
  34.     @bitmapa = self.set_size(@bitmapa, width, height)
  35.     @bitmapb.dispose if @bitmapb != nil
  36.     @bitmapb = self.set_size(@bitmapb, width + 2, height + 2)
  37.     @bitmapc.dispose if @bitmapc != nil
  38.     @bitmapc = self.set_size(@bitmapc, width + 4, height + 4)
  39.     self.bitmap.dispose if self.bitmap != nil
  40.     self.bitmap = @bitmapa
  41.     self.ox, self.oy = self.bitmap.width / 2, self.bitmap.height / 2
  42.   end
  43.   #--------------------------------------------------------------------------
  44.   # ● 半透明化
  45.   #--------------------------------------------------------------------------
  46.   def opacitysz(type)
  47.     if type == 0
  48.       self.opacity -= 8 if self.opacity > 180
  49.     else
  50.       self.opacity += 8 if self.opacity < 255
  51.     end
  52.   end
  53.   def set_size(bitmapcc, width, height)
  54.     bitmapcc = Bitmap.new(width, height)
  55.     bitmapcc.blt(0, 0, @bitmap, @rect[0])
  56.     bitmapcc.blt(0, height - 12, @bitmap, @rect[1])
  57.     bitmapcc.blt(width - 12, 0, @bitmap, @rect[2])
  58.     bitmapcc.blt(width - 12, height - 12, @bitmap, @rect[3])
  59.     @rect[4] = Rect.new(13, 0, 1, height)
  60.     if width > 24
  61.       for i in 1..width - 24
  62.         bitmapcc.blt(width - 12 - i, 0, @bitmap, @rect[4])
  63.       end
  64.     end
  65.     return bitmapcc
  66.   end
  67.   def set_update_type(type)
  68.     @utype = type
  69.     @ct = true
  70.   end
  71.   def update_type(type)
  72.     case type
  73.     when 0
  74.       self.opacity = 255 if self.opacity < 255 and @ct
  75.       self.bitmap = @bitmapa if @ct
  76.       self.ox, self.oy = self.bitmap.width / 2 - 2, self.bitmap.height / 2 - 2 if @ct
  77.       @count = @count1 = @wait_count = @wait_count1 = 0 if @ct
  78.       @tp = false if @ct
  79.       @ct = false if @ct
  80.       if @wait_count == 0
  81.         @count = 0
  82.       elsif @wait_count == 15
  83.         @count = 1
  84.       end
  85.       if @count == 0
  86.         self.opacity -= 8
  87.         @wait_count += 1
  88.       elsif @count == 1
  89.         self.opacity += 8
  90.         @wait_count -= 1
  91.       end
  92.     when 1
  93.       self.opacity = 255 if self.opacity < 255 and @ct
  94.       @count = @count1 = @wait_count = @wait_count1 =  0 if @ct
  95.       @tp = false if @ct
  96.       @ct = false if @ct
  97.       if @wait_count == 0
  98.         @count = 0
  99.       elsif @wait_count == 4
  100.         @count = 1
  101.       elsif @wait_count == 8
  102.         @count = 2
  103.       end
  104.       if @count == 0
  105.         self.bitmap = @bitmapa
  106.         self.ox, self.oy = self.bitmap.width / 2 - 2, self.bitmap.height / 2 - 2
  107.         @wait_count += 1
  108.         @tp = false if @tp
  109.       elsif @count == 1
  110.         self.bitmap = @bitmapb
  111.         self.ox, self.oy = self.bitmap.width / 2 - 1, self.bitmap.height / 2 - 1
  112.         @wait_count += 1 if !@tp
  113.         @wait_count -= 1 if @tp
  114.       elsif @count == 2
  115.         self.bitmap = @bitmapc
  116.         self.ox, self.oy = self.bitmap.width / 2, self.bitmap.height / 2
  117.         @wait_count -= 1
  118.         @tp = true if !@tp
  119.       end
  120.     when 2
  121.       self.opacity = 255 if self.opacity < 255 and @ct
  122.       self.bitmap = @bitmapa if @ct
  123.       self.ox, self.oy = self.bitmap.width / 2 - 2, self.bitmap.height / 2 - 2 if @ct
  124.       @count = @count1 = @wait_count =  @wait_count1 = 0 if @ct
  125.       @tp = false if @ct
  126.       @ct = false if @ct
  127.       if @wait_count == 0
  128.         @count = 0
  129.       elsif @wait_count == 4
  130.         @count = 1
  131.       elsif @wait_count == 8
  132.         @count = 2
  133.       end
  134.       if @wait_count1 == 0
  135.         @count1 = 0
  136.       elsif @wait_count1 == 15
  137.         @count1 = 1
  138.       end
  139.       if @count == 0
  140.         self.bitmap = @bitmapa
  141.         self.ox, self.oy = self.bitmap.width / 2 - 2, self.bitmap.height / 2 - 2
  142.         @wait_count += 1
  143.         @tp = false if @tp
  144.       elsif @count == 1
  145.         self.bitmap = @bitmapb
  146.         self.ox, self.oy = self.bitmap.width / 2 - 1, self.bitmap.height / 2 - 1
  147.         @wait_count += 1 if !@tp
  148.         @wait_count -= 1 if @tp
  149.       elsif @count == 2
  150.         self.bitmap = @bitmapc
  151.         self.ox, self.oy = self.bitmap.width / 2, self.bitmap.height / 2
  152.         @wait_count -= 1
  153.         @tp = true if !@tp
  154.       end
  155.       if @count1 == 0
  156.         self.opacity -= 8
  157.         @wait_count1 += 1
  158.       elsif @count1 == 1
  159.         self.opacity += 8
  160.         @wait_count1 -= 1
  161.       end
  162.     end
  163.   end
  164.   #--------------------------------------------------------------------------
  165.   # ● 释放
  166.   #--------------------------------------------------------------------------
  167.   def dispose
  168.     if self.bitmap != nil
  169.       self.bitmap.dispose
  170.     end
  171.     super
  172.   end
  173. end
复制代码
  1. #==============================================================================
  2. # □ Sprite_Cursor
  3. #==============================================================================
  4. class Sprite_Cursor_Rect < RPG::Sprite
  5.   def initialize(viewport)
  6.     super(viewport)
  7.     @bitmap_rect = Rect.new(1, 1, 30, 30)
  8.     @bitmap_rect1 = Rect.new(0, 0, 32, 32)
  9.     @bitmap = Bitmap.new(32, 32)
  10.     self.bitmap = Bitmap.new(1, 1)
  11.     @rect = Array.new(5)
  12.     @rect[0] = Rect.new(0, 0, 32, 1)
  13.     @rect[1] = Rect.new(0, 31, 32, 1)
  14.     @rect[2] = Rect.new(0, 1, 1, 30)
  15.     @rect[3] = Rect.new(31, 1, 1, 30)
  16.     @rect[4] = Rect.new(128, 64, 32, 32)
  17.     @count = 0
  18.     @wait_count = 0
  19.     @psize = [0, 0, 0, 0]
  20.     update
  21.   end
  22.   #--------------------------------------------------------------------------
  23.   # ● 更新画面
  24.   #--------------------------------------------------------------------------
  25.   def update
  26.     if self.visible
  27.       if @wait_count == 0
  28.         @count = 0
  29.       elsif @wait_count == 16
  30.         @count = 1
  31.       end
  32.       if @count == 0
  33.         self.opacity += 8
  34.         @wait_count += 1
  35.       elsif @count == 1
  36.         self.opacity -= 8
  37.         @wait_count -= 1
  38.       end
  39.     end
  40.   end
  41.   def set(x, y, width, height)
  42.     self.x, self.y = x, y
  43.     unless width == @psize[0] and height == @psize[1]
  44.       tdata = [width - 2, height - 2]
  45.       self.bitmap.dispose if self.bitmap != nil
  46.       self.bitmap = Bitmap.new(width, height)
  47.       @bitmap_rect1.width, @bitmap_rect1.height = width, height
  48.       self.bitmap.stretch_blt(@bitmap_rect1, @bitmap, @bitmap_rect)
  49.       rectx = Rect.new(0, 0, width, 1)
  50.       self.bitmap.stretch_blt(rectx, @bitmap, @rect[0])
  51.       rectx.y = height - 1
  52.       self.bitmap.stretch_blt(rectx, @bitmap, @rect[1])
  53.       rectx.y, rectx.width, rectx.height = 1, 1, tdata[1]
  54.       self.bitmap.stretch_blt(rectx, @bitmap, @rect[2])
  55.       rectx.x = width - 1
  56.       self.bitmap.stretch_blt(rectx, @bitmap, @rect[3])
  57.       self.bitmap.blur
  58.       @psize = [width, height]
  59.     end
  60.   end
  61.   def empty
  62.     self.x, self.y = 0, 0
  63.     self.bitmap.dispose if self.bitmap != nil
  64.     self.bitmap = Bitmap.new(1, 1)
  65.     @psize = [1, 1]
  66.   end
  67.   def windowskin=(windowskin)
  68.     @bitmap.blt(0, 0, windowskin, @rect[4])
  69.     self.set(self.x, self.y, self.bitmap.width, self.bitmap.height)
  70.   end
  71.   #--------------------------------------------------------------------------
  72.   # ● 释放
  73.   #--------------------------------------------------------------------------
  74.   def dispose
  75.     if self.bitmap != nil
  76.       self.bitmap.dispose
  77.     end
  78.     super
  79.   end
  80. end
复制代码
  1. #==============================================================================
  2. # ■ Arrow_Base
  3. #------------------------------------------------------------------------------
  4. #  在战斗画面使用的箭头光标的活动块。本类作为
  5. # Arrow_Enemy 类与 Arrow_Actor 类的超级类使用。
  6. #==============================================================================

  7. class Sprite_Pause_Cursor < RPG::Sprite
  8.   #--------------------------------------------------------------------------
  9.   # ● 初始化对像
  10.   #     viewport : 显示端口
  11.   #--------------------------------------------------------------------------
  12.   def initialize(viewport)
  13.     super(viewport)
  14.     self.bitmap = Bitmap.new(32, 32)
  15.     self.visible = false
  16.     @rect = Rect.new(160, 64, 32, 32)
  17.     @count = 0
  18.     @wait_count = 0
  19.     update
  20.   end
  21.   #--------------------------------------------------------------------------
  22.   # ● 刷新画面
  23.   #--------------------------------------------------------------------------
  24.   def update
  25.     @wait_count += 1
  26.     if @wait_count == 7
  27.       case @count
  28.       when 0
  29.         self.src_rect.set(0, 0, 16, 16)
  30.         @count = 1
  31.       when 1
  32.         self.src_rect.set(16, 0, 16, 16)
  33.         @count = 2
  34.       when 2
  35.         self.src_rect.set(0, 16, 16, 16)
  36.         @count = 3
  37.       when 3
  38.         self.src_rect.set(16, 16, 16, 16)
  39.         @count = 0
  40.       end
  41.       @wait_count = 0
  42.     end
  43.   end
  44.   def windowskin=(windowskin)
  45.     self.bitmap.blt(0, 0, windowskin, @rect)
  46.     self.src_rect.set(0, 0, 16, 16)
  47.     @count = @wait_count = 0
  48.   end
  49.   #--------------------------------------------------------------------------
  50.   # ● 释放
  51.   #--------------------------------------------------------------------------
  52.   def dispose
  53.     if self.bitmap != nil
  54.       self.bitmap.dispose
  55.     end
  56.     super
  57.   end
  58. end
复制代码


字数不够了……

正在研究自己编写 DLL 来调用 DirectX ……DLL 完成了,脚本却遇到问题了……

Lv4.逐梦者

梦石
0
星屑
11986
在线时间
999 小时
注册时间
2007-12-15
帖子
188
2
 楼主| 发表于 2008-9-2 01:01:55 | 只看该作者
接主楼……

辅助脚本:
  1. #==============================================================================
  2. # ■ Arrow_Base
  3. #------------------------------------------------------------------------------
  4. #  在战斗画面使用的箭头光标的活动块。本类作为
  5. # Arrow_Enemy 类与 Arrow_Actor 类的超级类使用。
  6. #==============================================================================

  7. class Sprite_Arrow_Cursor < RPG::Sprite
  8.   #--------------------------------------------------------------------------
  9.   # ● 定义实例变量
  10.   #--------------------------------------------------------------------------
  11.   attr_accessor :count                  #
  12.   attr_accessor :wait_count                  #
  13.   #--------------------------------------------------------------------------
  14.   # ● 初始化对像
  15.   #     viewport : 显示端口
  16.   #--------------------------------------------------------------------------
  17.   def initialize(viewport, wz)
  18.     super(viewport)
  19.     self.bitmap = Bitmap.new(16, 16)
  20.     self.visible = false
  21.     @wz = wz
  22.     @rect = Array.new(4)
  23.     @rect[0] = Rect.new(152, 16, 16, 8)
  24.     @rect[1] = Rect.new(152, 40, 16, 8)
  25.     @rect[2] = Rect.new(144, 24, 8, 16)
  26.     @rect[3] = Rect.new(168, 24, 8, 16)
  27.     @count = 0
  28.     @wait_count = 0
  29.     update
  30.   end
  31.   #--------------------------------------------------------------------------
  32.   # ● 刷新画面
  33.   #--------------------------------------------------------------------------
  34.   def update
  35.     if self.visible
  36.       if @wait_count == 0
  37.         @count = 0
  38.       elsif @wait_count == 16
  39.         @count = 1
  40.       end
  41.       if @count == 0
  42.         self.opacity += 8
  43.         @wait_count += 1
  44.       elsif @count == 1
  45.         self.opacity -= 8
  46.         @wait_count -= 1
  47.       end
  48.     end
  49.   end
  50.   def windowskin=(windowskin)
  51.     self.bitmap.blt(0, 0, windowskin, @rect[@wz])
  52.     @count = @wait_count = 0
  53.   end
  54.   #--------------------------------------------------------------------------
  55.   # ● 释放
  56.   #--------------------------------------------------------------------------
  57.   def dispose
  58.     if self.bitmap != nil
  59.       self.bitmap.dispose
  60.     end
  61.     super
  62.   end
  63. end
复制代码


猫哥哥的 Bitmap 模糊化脚本(简化了一下):
  1. #===============================================================#
  2. #                                                               #
  3. #   ●RGSS2_bitmap_xp ver 1.02                                  #
  4. #                                                               #
  5. #                    by 猫哥哥        [email protected]     #
  6. #                                                               #
  7. #===============================================================#
  8. class Bitmap
  9.    
  10. def blur(times=1,during =1,blur=1)
  11.    #blur(重做模糊次数,经历帧数,分散半径)
  12.    for i in 1..times
  13.      blur_r(blur)
  14.      for j in 1..during
  15.        Graphics.update if i > 1 and during >1
  16.      end     
  17.    end   
  18. end
  19. #----------------------------------------------------------------
  20. def blur_r(radius = 2)
  21.     #blur_r(分散半径)
  22.     radius = 1 if radius <= 1 or radius == nil #值的修正
  23.     src_bitmap = self
  24.     rect = self.rect
  25.    
  26.     ta_l = 1+radius*2
  27.     ta = Table.new(ta_l,ta_l)  #过滤器

  28.     for i in 0..ta_l-1
  29.       for j in 0..ta_l-1
  30.         ta[i,j] = 1
  31.       end
  32.     end

  33.       ta[((ta.xsize+1)/2)-1,((ta.xsize+1)/2)-1] = 2**(1+radius)
  34.       main = ta[((ta.xsize+1)/2)-1,((ta.xsize+1)/2)-1]#找到中心点

  35.       nn = 2;j = ((ta.xsize+1)/2)-1;line =[]#主干道
  36.       for i in 0..((ta.xsize+1)/2)-2
  37.         ta[i,j] = nn
  38.         ta[j,i] = nn
  39.         ta[ta.xsize-1-i,j] = nn
  40.         ta[j,ta.xsize-1-i] = nn
  41.         line.push ta[i,((ta.xsize+1)/2)-1]
  42.         nn = nn * 2
  43.       end
  44.    
  45.     for j in 0..line.size-1
  46.        for i in 0..((ta.xsize+1)/2)-2
  47.         line[j] = line[j]/2
  48.         if line[j] == 1
  49.           break
  50.         else
  51.           ta[((ta.xsize+1)/2)-2-i,j] = line[j]
  52.           ta[((ta.xsize+1)/2)+i,j] = line[j]
  53.           ta[((ta.xsize+1)/2)-2-i,ta.xsize-1-j] = line[j]
  54.           ta[((ta.xsize+1)/2)+i,ta.xsize-1-j] = line[j]
  55.         end
  56.       end
  57.     end
  58.     key_a = [];key_p = main
  59.     for i in 1..main
  60.       if key_p == 1
  61.         key_a.push main
  62.         break
  63.       else
  64.       key_p = key_p/2
  65.       key_a.push key_p
  66.       end
  67.     end
  68.     key_k = 0
  69.     for i in 0..key_a.size-1
  70.       key_k = key_k + key_a[i]
  71.     end
  72.     key = 255/key_k
  73.     key = 1 if key <= 0  #值的修正

  74.    for i in 0..ta.xsize-1
  75.         for j in 0..ta.ysize-1
  76.             key_main = key*ta[i,j]
  77.             key_main = 255 if key_main > 255 ; key_main = 1 if key_main < 0  #值的修正
  78.             self.blt(i-(((ta.xsize+1)/2)-1),j-(((ta.xsize+1)/2)-1),src_bitmap,rect,key_main)
  79.         end
  80.     end
  81.   end
  82. end  
复制代码

将这两张图片放到 Graphics\Windowskins 目录下(需要改名)
http://rpg.blue/upload_program/files/cursor_100717609.png
http://rpg.blue/upload_program/files/cursora_100717708.png

顺便说下用法:

BK_SIZE = 16  #窗口内容和边框的间距,默认的是和原版一样的16,根据自己的需
              #要设置
set_cursor_rect(on_off)  #是否显示光标矩形
set_cursor_a(on_off)     #是否显示动态光标 A
set_cursor_a_s(on_off)   #是否显示静态光标 A
set_cursor_b(on_off)     #是否显示动态光标 B
set_name(namesz = "", wz1 = 0, wz2 = BK_SIZE, font = Font.new, align = 0)
#设置窗口上显示的窗口名
例子:在菜单画面中的命令窗口上显示“命令”两字
    tfont = Font.new("宋体", 16)
    tfont.bold = true
    tfont.color = Color.new(120,220,60,255)
    @command_window.set_name("命令",0,8,tfont,0)
效果:

正在研究自己编写 DLL 来调用 DirectX ……DLL 完成了,脚本却遇到问题了……
回复 支持 反对

使用道具 举报

Lv1.梦旅人

辉瑞中国首席研究员<

梦石
0
星屑
50
在线时间
142 小时
注册时间
2008-1-18
帖子
2129
3
发表于 2008-9-2 01:09:04 | 只看该作者
强悍的东西{/qiang}
又看到一个人写WINDOW
来6r就是等某位仁兄的巨坑

褴褛着身行无端,囊中羞涩空心酸。
平生几无得意事,倒塔泡面宅寝室。
惟羡隔壁高帅富,雨露春风月夜声。
青丝无处觅其踪,只有硬盘苍井空。
莫云男儿空悲愁,鸿鹄岂不天际游。
坐断天下执鹿首,千百金帛万兜鍪。
夜深忽梦某年月,再见女神欲语迟。
吊丝终有逆袭日,木耳再无回粉时。
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
49
在线时间
157 小时
注册时间
2007-12-16
帖子
3454
4
发表于 2008-9-2 01:37:11 | 只看该作者
截图呢
回复 支持 反对

使用道具 举报

头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
49
在线时间
0 小时
注册时间
2007-7-1
帖子
552
5
发表于 2008-9-2 07:23:12 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
签名被屏蔽
回复 支持 反对

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
11986
在线时间
999 小时
注册时间
2007-12-15
帖子
188
6
 楼主| 发表于 2008-9-2 18:09:49 | 只看该作者
以下引用做游戏的新手于2008-9-1 17:37:11的发言:

截图呢


截图:


注意文字显示的 Y 坐标。

正在研究自己编写 DLL 来调用 DirectX ……DLL 完成了,脚本却遇到问题了……
回复 支持 反对

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
11986
在线时间
999 小时
注册时间
2007-12-15
帖子
188
7
 楼主| 发表于 2008-9-2 18:30:50 | 只看该作者
以下引用dna_7086于2008-9-1 23:23:12的发言:

我还是想要用CreateWindowEx做的窗口~~~


这个脚本的作用和 CreateWindowEx 不同,不是创建窗口,而是对窗口效果的增强……
下一步我准备增加动态边框和动态背景功能,对动态光标 A 进行强化,增加多帧动画模式……

正在研究自己编写 DLL 来调用 DirectX ……DLL 完成了,脚本却遇到问题了……
回复 支持 反对

使用道具 举报

头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
49
在线时间
0 小时
注册时间
2007-7-1
帖子
552
8
发表于 2008-9-2 21:31:09 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
签名被屏蔽
回复 支持 反对

使用道具 举报

Lv1.梦旅人

辉瑞中国首席研究员<

梦石
0
星屑
50
在线时间
142 小时
注册时间
2008-1-18
帖子
2129
9
发表于 2008-9-3 04:40:00 | 只看该作者
以下引用dna_7086于2008-9-2 13:31:09的发言:


以下引用洛克人SZ于2008-9-2 10:30:50的发言:
这个脚本的作用和 CreateWindowEx 不同,不是创建窗口,而是对窗口效果的增强……
下一步我准备增加动态边框和动态背景功能,对动态光标 A 进行强化,增加多帧动画模式……



知道呀,你的是基于RM里的Window类
CreateWindowEx是基于WINDOWS的Window类
我只是想知道CreateWindowEx怎么才能避开RM的画面刷新,不然新建的窗口会不停地闪,这样用API创建的控件也一直闪,我直接新建一个文本框就是……


主站上的AVI播放脚本也用到CREATWINDOW来创建窗口,解决了这个问题,你可以去看一下

来6r就是等某位仁兄的巨坑

褴褛着身行无端,囊中羞涩空心酸。
平生几无得意事,倒塔泡面宅寝室。
惟羡隔壁高帅富,雨露春风月夜声。
青丝无处觅其踪,只有硬盘苍井空。
莫云男儿空悲愁,鸿鹄岂不天际游。
坐断天下执鹿首,千百金帛万兜鍪。
夜深忽梦某年月,再见女神欲语迟。
吊丝终有逆袭日,木耳再无回粉时。
回复 支持 反对

使用道具 举报

头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
49
在线时间
0 小时
注册时间
2007-7-1
帖子
552
10
发表于 2008-9-3 04:55:16 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
签名被屏蔽
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-5-9 07:22

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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