기타

게임 화면에 좌표 띄우기

by windshy posted Jan 25, 2010
?

단축키

Prev이전 문서

Next다음 문서

ESC닫기

크게 작게 위로 아래로 댓글로 가기 인쇄
Extra Form
출처 xpcustom

#==============================================================================
# 걽 CUSTOM
#==============================================================================

module PLAN_SCREEN_XY
  VISIBLE    = true            # 궞궻긚긏깏긵긣귩럊뾭궥귡궔궵궎궔
                                # (true:궥귡, false:궢궶궋)
  WIN_X = 32                    # 긂귻깛긤긂궻 X 띆뷭
  WIN_Y = 32                    # 긂귻깛긤긂궻 Y 띆뷭
  FONT_SIZE  = 11              # 긲긅깛긣긖귽긛
  WIN_WIDTH  = 120            # 긂귻깛긤긂궻븴
  WIN_OPACITY = 128            # 긂귻깛긤긂궻벁뼻뱗
end


if PLAN_SCREEN_XY::VISIBLE

#==============================================================================
# 걾 Scene_Map
#============================================================================

class Scene_Map
  #--------------------------------------------------------------------------
  # 걶 긽귽깛룉뿚
  #--------------------------------------------------------------------------
  alias plan_screen_xy_main main
  def main
    # 긂귻깛긤긂귩띿맟
    @screen_xy_window = Window_Screen_XY.new
    # 뙰궸뽣궥
    plan_screen_xy_main
    # 긂귻깛긤긂귩됶뺳
    @screen_xy_window.dispose
  end
  #--------------------------------------------------------------------------
  # 걶 긲깒??뛛륷
  #--------------------------------------------------------------------------
  alias plan_screen_xy_update update
  def update
    @screen_xy_window.update
    # 뙰궸뽣궥
    plan_screen_xy_update
  end
end


#==============================================================================
# 걾 Window_Screen_XY
#==============================================================================

class Window_Screen_XY < Window_Base
  #--------------------------------------------------------------------------
  # 걶 긆긳긙긃긏긣룊딖돸
  #--------------------------------------------------------------------------
  def initialize
    one_line = ((PLAN_SCREEN_XY::FONT_SIZE * 100 / 22) * 32) / 100
    super(PLAN_SCREEN_XY::WIN_X, PLAN_SCREEN_XY::WIN_Y, PLAN_SCREEN_XY::WIN_WIDTH, 32+one_line*2)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.font.size = PLAN_SCREEN_XY::FONT_SIZE
    self.opacity = PLAN_SCREEN_XY::WIN_OPACITY
    @old_x = $game_player.x
    @old_y = $game_player.y
    refresh
  end
  #--------------------------------------------------------------------------
  # 걶 깏긲깒긞긘깄
  #--------------------------------------------------------------------------
  def refresh
    one_line = ((PLAN_SCREEN_XY::FONT_SIZE * 100 / 22) * 32) / 100
    self.contents.clear
    self.contents.draw_text(4, 0, self.contents.width-8, one_line, "X:", 0)
    self.contents.draw_text(4, 0, self.contents.width-8, one_line, $game_player.x.to_s, 2)
    self.contents.draw_text(4, one_line, self.contents.width-8, one_line, "Y:", 0)
    self.contents.draw_text(4, one_line, self.contents.width-8, one_line, $game_player.y.to_s, 2)
  end
  #--------------------------------------------------------------------------
  # 걶 긲깒??뛛륷
  #--------------------------------------------------------------------------
  def update
    if @old_x != $game_player.x or @old_y != $game_player.y
      refresh
      @old_x = $game_player.x
      @old_y = $game_player.y
    end
  end
end

end

 

==========

 

게임 화면 내에 좌표를 설정하는 스크립트입니다

 

게임 내에 디테일하게 쓰일거같진 않고 그냥 픽쳐를 넣을때 좌표 참고나

 

아니면 이를 이용해서 또 색다른 퍼즐을 만들수도 ㅇㅂㅇ

 

예제와 활용사진을 첨부했으니 참고하시기 바랍니다 ㅇㅂㅇ



Fatal error: Cannot access property sessionController::$lifetime in /web/old/xe/modules/session/session.controller.php on line 45