XP 스크립트

Near Fantastica씨의 마우스 스크립트입니다.  일부 스크립트에서 이 것을 필요로 합니다.  물론 다른 마우스 입력 스크립트와 혼용불가입니다. 


#==============================================================================
# ** Mouse Input Module
#------------------------------------------------------------------------------
# Near Fantastica
# Version 5
# 01.03.06
#------------------------------------------------------------------------------
# This module defines mouse input
#==============================================================================

#------------------------------------------------------------------------------
# * SDK Log Script
#------------------------------------------------------------------------------
SDK.log("Mouse Input", "Near Fantastica", 5, "01.03.06")

#------------------------------------------------------------------------------
# * Begin SDK Enable Test
#------------------------------------------------------------------------------
if SDK.state("Mouse Input") == true

module Mouse
  @position
  GSM = Win32API.new('user32', 'GetSystemMetrics', 'i', 'i')
  Cursor_Pos= Win32API.new('user32', 'GetCursorPos', 'p', 'i')
  Scr2cli = Win32API.new('user32', 'ScreenToClient', %w(l p), 'i')
  Client_rect = Win32API.new('user32', 'GetClientRect', %w(l p), 'i')
  Readini = Win32API.new('kernel32', 'GetPrivateProfileStringA', %w(p p p p l p), 'l')
  Findwindow = Win32API.new('user32', 'FindWindowA', %w(p p), 'l')
  #-------------------------------------------------------------------------- 
  def Mouse.grid
    return nil if @pos == nil
    offsetx = $game_map.display_x / 4
    offsety = $game_map.display_y / 4
    x = (@pos[0] + offsetx) / 32
    y = (@pos[1] + offsety) / 32
    return [x, y]
  end
  #-------------------------------------------------------------------------- 
  def Mouse.position
    return @pos == nil ? [0, 0] : @pos
  end
  #-------------------------------------------------------------------------- 
  def Mouse.global_pos
    pos = [0, 0].pack('ll')
    if Cursor_Pos.call(pos) != 0
      return pos.unpack('ll')
    else
      return nil
    end
  end
  #-------------------------------------------------------------------------- 
  def Mouse.pos
    x, y = Mouse.screen_to_client(*Mouse.global_pos)
    width, height = Mouse.client_size
    begin
      if (x >= 0 and y >= 0 and x < width and y < height)
        return x, y
      else
        return nil
      end
    rescue
      return nil
    end
  end
  #-------------------------------------------------------------------------- 
  def Mouse.update
    @pos = Mouse.pos
  end
  #-------------------------------------------------------------------------- 
  def Mouse.screen_to_client(x, y)
    return nil unless x and y
    pos = [x, y].pack('ll')
    if Scr2cli.call(Mouse.hwnd, pos) != 0
      return pos.unpack('ll')
    else
      return nil
    end
  end
  #-------------------------------------------------------------------------- 
  def Mouse.hwnd
    game_name = "" * 256
    Readini.call('Game','Title','',game_name,255,".\Game.ini")
    game_name.delete!("")
    return Findwindow.call('RGSS Player',game_name)
  end
  #-------------------------------------------------------------------------- 
  def Mouse.client_size
    rect = [0, 0, 0, 0].pack('l4')
    Client_rect.call(Mouse.hwnd, rect)
    right, bottom = rect.unpack('l4')[2..3]
    return right, bottom
  end
end

#------------------------------------------------------------------------------
# * End SDK Enable Test
#------------------------------------------------------------------------------
end

Who's 백호

?

이상혁입니다.

http://elab.kr

Comment '2'

List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
공지 스크립트 자료 게시물 작성시 주의사항 습작 2012.12.24 6203
561 스킬 스킬 추가 공격 스크립트 7 file 백호 2009.02.21 1697
560 이동 및 탈것 이벤트의 스크립트로 기동하는 점프 루트 완성 2 file 백호 2009.02.21 1698
559 전투 사이비 CTB 1 file 백호 2009.02.21 1701
558 이동 및 탈것 8방향 이동 & 대쉬 스크립트 5 백호 2009.02.21 1703
557 영상 The AVI Player 1.3 by DerVVulfman 3 Alkaid 2010.10.08 1707
556 전투 Kingdom Hearts 스타일의 전투 시스템 1 백호 2009.02.21 1709
555 기타 레벨, 능력치 무한 스크립트 3 백호 2009.02.22 1712
554 스킬 스킬 Learning 스크립트 1 file 백호 2009.02.21 1713
553 전투 KGC_SeparationCommand file 백호 2009.02.22 1713
552 상점 상점에서 Q.W버튼으로 순서를 바꿈!상점스텟 상세화 업그레이드 1 백호 2009.02.21 1714
551 기타 테트리스 ?구현 스크립트 2 file 백호 2009.02.21 1715
550 기타 양손무기, 전신갑옷 스크립트 2 백호 2009.02.22 1716
549 전투 KGC_RankConception(대열 개념) file 백호 2009.02.22 1719
548 직업 직업마다 다른 성장 2 백호 2009.02.22 1725
547 기타 창고 스크립트 5 긔염둥이♥ 2012.06.18 1727
546 기타 CG그림 감상 스크립트 file 백호 2009.02.21 1735
545 기타 일본RPGXP게임에서 번역한 스크립트 입니다. 1 백호 2009.02.22 1735
544 장비 CSSR5-장비품 중량 시스템 1 file 백호 2009.02.22 1736
543 기타 간단한 Scene_Base #2 2 Alkaid 2012.01.15 1738
542 메시지 Universal Message System 1.8.0 by ccoa 번역 4 file PerrS 2013.04.06 1739
Board Pagination Prev 1 ... 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 ... 52 Next
/ 52