Krótki opis:
Rozszerza okno wiadomości na długość całego okna gry.
Autor:
Rukiri
Kompatybilność:
RPG Maker VX Ace
Skrypt:
Spoiler:
Kod:
#==============================================================================
# ■ Game_Resolution
#------------------------------------------------------------------------------
# Change the game window to whatever you want!
# Keep the width and height a multiple of 32.
#==============================================================================
module Resolution
$game_screen_width = 640
$game_screen_height = 480
$game_tiles_width = 20
$game_tiles_height = 15
#======================================
# Resize the window
#======================================
def self.resize(w,h)
Graphics.resize_screen(w,h)
$game_screen_width = w
$game_screen_height = h
$game_tiles_width = w / 32
$game_tiles_height = h / 32
end
end
#==============================================================================
# ■ Sprite_Timer
#------------------------------------------------------------------------------
# Timer for display sprites. Monitor the $ game_timer, the state of the Sprite
# To change automatically.
#==============================================================================
class Sprite_Timer
#--------------------------------------------------------------------------
# ● Initialize
#--------------------------------------------------------------------------
def initialize(viewport)
super(viewport)
create_bitmap
update
end
#--------------------------------------------------------------------------
# ● Create bitmap
#--------------------------------------------------------------------------
def create_bitmap
self.bitmap = Bitmap.new(96, 48)
self.bitmap.font.size = 32
self.bitmap.font.color.set(255, 255, 255)
end
#--------------------------------------------------------------------------
# ● Update
#--------------------------------------------------------------------------
def update
super
update_bitmap
update_position
update_visibility
end
#--------------------------------------------------------------------------
# ● Update position
#--------------------------------------------------------------------------
def update_position
self.x = $game_screen_width - self.bitmap.width
self.y = 0
self.z = 200
end
end
#==============================================================================
# ■ Game_Map
#------------------------------------------------------------------------------
# A class to handle the map. It has features such as scrolling and passable determining.
# Instance of this class is referenced by $ game_map.
#==============================================================================
class Game_Map
def update(main = false)
refresh if @need_refresh
update_interpreter if main
update_scroll
update_events
update_vehicles
update_parallax
@screen.update
end
#--------------------------------------------------------------------------
# ● Setup Scroll
#--------------------------------------------------------------------------
def setup_scroll
@scroll_direction = 2
@scroll_rest = 0
@scroll_speed = 4
end
#--------------------------------------------------------------------------
# ● Set display position
#--------------------------------------------------------------------------
def set_display_pos(x, y)
x = [0, [x, $game_screen_width - $game_tiles_width].min].max unless loop_horizontal?
y = [0, [y, $game_screen_height - $game_tiles_height].min].max unless loop_vertical?
@display_x = (x + $game_screen_width) % $game_screen_width
@display_y = (y + $game_screen_height) % $game_screen_height
@parallax_x = x
@parallax_y = y
end
#--------------------------------------------------------------------------
# ● Parallax X check
#--------------------------------------------------------------------------
def parallax_ox(bitmap)
if @parallax_loop_x
@parallax_x * 16
else
w1 = [bitmap.width - $game_screen_width, 0].max
w2 = [$game_screen_width * 32 - $game_screen_width, 1].max
@parallax_x * 16 * w1 / w2
end
end
#--------------------------------------------------------------------------
# ● Adjust X
#--------------------------------------------------------------------------
def adjust_x(x)
if loop_horizontal? && x < @display_x - ($game_screen_width - $game_tiles_width) / 2
x - @display_x + $game_screen_width
else
x - @display_x
end
end
#--------------------------------------------------------------------------
# ● Adjust Y
#--------------------------------------------------------------------------
def adjust_y(y)
if loop_vertical? && y < @display_y - ($game_screen_height - $game_tiles_height) / 2
y - @display_y + $game_screen_height
else
y - @display_y
end
end
#--------------------------------------------------------------------------
# ● ループ補正後の X 座標計算
#--------------------------------------------------------------------------
def round_x(x)
loop_horizontal? ? (x + $game_screen_width) % $game_screen_width : x
end
#--------------------------------------------------------------------------
# ● ループ補正後の Y 座標計算
#--------------------------------------------------------------------------
def round_y(y)
loop_vertical? ? (y + $game_screen_height) % $game_screen_height : y
end
#--------------------------------------------------------------------------
# ● 上にスクロール
#--------------------------------------------------------------------------
def scroll_up(distance)
if loop_vertical?
@display_y += @map.height - distance
@display_y %= @map.height
@parallax_y -= distance if @parallax_loop_y
else
last_y = @display_y
@display_y = [@display_y - distance, 0].max
@parallax_y += @display_y - last_y
end
end
end
class Game_Player < Game_Character
#--------------------------------------------------------------------------
# ● 画面中央の X 座標
#--------------------------------------------------------------------------
def center_x
if $game_screen_width == 640
($game_screen_width / 32 - 1) / 1.0
else
($game_screen_width / 32 - 1) / 2.0
end
end
#--------------------------------------------------------------------------
# ● 画面中央の Y 座標
#--------------------------------------------------------------------------
def center_y
if $game_screen_height == 480
($game_screen_height / 32 - 1) / 1.0
else
($game_screen_height / 32 - 1) / 2.0
end
end
#--------------------------------------------------------------------------
# ● 画面中央に来るようにマップの表示位置を設定
#--------------------------------------------------------------------------
def center(x, y)
$game_map.set_display_pos(x - center_x, y - center_y)
end
#--------------------------------------------------------------------------
# ● フレーム更新
#--------------------------------------------------------------------------
def update
last_real_x = @real_x
last_real_y = @real_y
last_moving = moving?
move_by_input
super
update_scroll(last_real_x, last_real_y)
update_vehicle
update_nonmoving(last_moving) unless moving?
@followers.update
end
end
class Window_Base
#--------------------------------------------------------------------------
# ● ステートおよび強化/弱体のアイコンを描画
#--------------------------------------------------------------------------
def draw_actor_icons(actor, x, y, width = 96)
icons = (actor.state_icons + actor.buff_icons)[0, width / 24]
end
end
Nie możesz pisać nowych tematów Nie możesz odpowiadać w tematach Nie możesz zmieniać swoich postów Nie możesz usuwać swoich postów Nie możesz głosować w ankietach Nie możesz załączać plików na tym forum Możesz ściągać załączniki na tym forum