-
Agckuu_Coceg
-
-
Вне сайта
-
Архитектор Миров
-
-
Простой Гинтокист с огромной внутренней ленью.
- Сообщений: 1549
- Спасибо получено: 329
-
-
|
Ну, вот я какой-то нашёл... Этот не использует *dll, но он требует множество эдитов.
#==============================================================================
# ** Screen_Data
#------------------------------------------------------------------------------
# This module handles the information regarding screen size. It is used within
# the Screen_Size, Game_Map, Game_Player, Spriteset_Map, and Spriteset_Battle
# classes.
#==============================================================================
module Screen_Data
Screen_Data = [20, 15, 640, 480, 2]
end
#==============================================================================
# ** Screen_Size
#------------------------------------------------------------------------------
# This class handles the screen size. It is used within the Game_Map,
# Game_Actor, Spriteset_Map, and Spriteset_Battle classes.
#==============================================================================
begin
class Screen_Size
#--------------------------------------------------------------------------
# * Change Screen Size
#--------------------------------------------------------------------------
def change_screen_size(width, height)
window_width = width * (16 * Screen_Data::Screen_Data[4].to_s.to_f).to_i
window_height = height * (16 * Screen_Data::Screen_Data[4].to_s.to_f).to_i
Screen_Data::Screen_Data[0] = width
Screen_Data::Screen_Data[1] = height
Screen_Data::Screen_Data[2] = window_width
Screen_Data::Screen_Data[3] = window_height
size = Screen_Data::Screen_Data[4].to_s.to_f
self.resize_window(window_width, window_height)
end
#--------------------------------------------------------------------------
# * Handle Window Size Changes
#--------------------------------------------------------------------------
def resize_window(width, height)
game_title = "\0" * 256
window_info = Win32API.new('kernel32', 'GetPrivateProfileString',
%w(p p p p l p), 'l')
window_info.call("Game", "Title", "", game_title, 256, ".\\Game.ini" )
game_title.delete!("\0")
system_metrics = Win32API.new('user32', 'GetSystemMetrics', 'I', 'I')
screen_width = system_metrics.call(0)
x_pos = (screen_width - (width + 6)) / 2
screen_height = system_metrics.call(1)
y_pos = (screen_height - (height + 32)) / 2
find_window = Win32API.new('user32', 'FindWindow', %(p, p), 'i')
window = find_window.call("RGSS Player", game_title)
winpos = Win32API.new('user32', 'SetWindowPos', %(l, l, i, i, i, i, i), 'i')
winpos.call(window, 0, x_pos, y_pos - 1, width + 6, height + 32, 0)
winpos.call(window, 0, x_pos, y_pos, width + 6, height + 32, 0)
end
end
end
#==============================================================================
# ** Game_Map
#------------------------------------------------------------------------------
# This class handles the map. It includes scrolling and passable determining
# functions. Refer to "$game_map" for the instance of this class.
#==============================================================================
class Game_Map
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
alias glitchfinder_classic_screensize_initialize initialize
def initialize
glitchfinder_classic_screensize_initialize
@size = Screen_Data::Screen_Data[4].to_s.to_f
@width = Screen_Data::Screen_Data[0].to_s.to_i
@height = Screen_Data::Screen_Data[1].to_s.to_i
end
#--------------------------------------------------------------------------
# * Scroll Down
# distance : scroll distance
#--------------------------------------------------------------------------
def scroll_down(distance)
@display_y = [@display_y + distance, ((self.height - @height) *
(64 * @size).to_i)].min
end
#--------------------------------------------------------------------------
# * Scroll Right
# distance : scroll distance
#--------------------------------------------------------------------------
def scroll_right(distance)
@display_x = [@display_x + distance, ((self.width - @width) *
(64 * @size).to_i)].min
end
#--------------------------------------------------------------------------
# * Start Scroll
# direction : scroll direction
# distance : scroll distance
# speed : scroll speed
#--------------------------------------------------------------------------
def start_scroll(direction, distance, speed)
@scroll_direction = direction
@scroll_rest = distance * (64 * @size).to_i
@scroll_speed = speed
end
end
#==============================================================================
# ** Game_Character
#------------------------------------------------------------------------------
# This class deals with characters. It's used as a superclass for the
# Game_Player and Game_Event classes.
#==============================================================================
class Game_Character
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
alias glitchfinder_classic_screensize_gchar_initialize initialize
def initialize
glitchfinder_classic_screensize_gchar_initialize
@size = Screen_Data::Screen_Data[4].to_s.to_f
width = Screen_Data::Screen_Data[2].to_s.to_i / 2
height = Screen_Data::Screen_Data[3].to_s.to_i / 2
@move_speed = 4 + (((@size / 2 ).to_i - 1) * 2)
@center_x = (((width / 2).to_i * @size).to_i - (8 * @size).to_i) * 4
@center_y = (((height / 2).to_i * @size).to_i - (8 * @size).to_i) * 4
end
#--------------------------------------------------------------------------
# * Determine if Moving
#--------------------------------------------------------------------------
def moving?
# If logical coordinates differ from real coordinates,
# movement is occurring.
return (@real_x != @x * (64 * @size).to_i or
@real_y != @y * (64 * @size).to_i)
end
#--------------------------------------------------------------------------
# * Move to Designated Position
# x : x-coordinate
# y : y-coordinate
#--------------------------------------------------------------------------
def moveto(x, y)
@x = x % $game_map.width
@y = y % $game_map.height
@real_x = @x * (64 * @size).to_i
@real_y = @y * (64 * @size).to_i
@prelock_direction = 0
end
#--------------------------------------------------------------------------
# * Get Screen X-Coordinates
#--------------------------------------------------------------------------
def screen_x
# Get screen coordinates from real coordinates and map display position
return (@real_x - $game_map.display_x + 3) / 4 + (16 * (@size / 2).to_i)
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
alias glitchfinder_classic_screensize_update update
def update
glitchfinder_classic_screensize_update
# If animation count exceeds maximum value
# * Maximum value is move speed * 1 taken from basic value 18
if @anime_count > 18 - @move_speed * ((@size / 2 ).to_i - 1)
# If stop animation is OFF when stopping
if not @step_anime and @stop_count > 0
# Return to original pattern
@pattern = @original_pattern
# If stop animation is ON when moving
else
# Update pattern
@pattern = (@pattern + 1) % 4
end
# Clear animation count
@anime_count = 0
end
@zoom = (0.50 * @size.to_f)
end
#--------------------------------------------------------------------------
# * Frame Update (jump)
#--------------------------------------------------------------------------
def update_jump
# Reduce jump count by 1
@jump_count -= 1
# Calculate new coordinates
@real_x = ((@real_x * @jump_count + @x * (128 * @size / 2).to_i) /
(@jump_count + 1))
@real_y = ((@real_y * @jump_count + @y * (128 * @size / 2).to_i) /
(@jump_count + 1))
end
#--------------------------------------------------------------------------
# * Update frame (move)
#--------------------------------------------------------------------------
def update_move
# Convert map coordinates from map move speed into move distance
distance = 2 ** @move_speed
# If logical coordinates are further down than real coordinates
if @y * ((128 * @size).to_i / 2) > @real_y
# Move down
@real_y = [@real_y + distance, @y * (64 * @size).to_i].min
end
# If logical coordinates are more to the left than real coordinates
if @x * ((128 * @size).to_i / 2) < @real_x
# Move left
@real_x = [@real_x - distance, @x * (64 * @size).to_i].max
end
# If logical coordinates are more to the right than real coordinates
if @x * ((128 * @size).to_i / 2) > @real_x
# Move right
@real_x = [@real_x + distance, @x * (64 * @size).to_i].min
end
# If logical coordinates are further up than real coordinates
if @y * ((128 * @size).to_i / 2) < @real_y
# Move up
@real_y = [@real_y - distance, @y * (64 * @size).to_i].max
end
# If move animation is ON
if @walk_anime
# Increase animation count by 1.5
@anime_count += 1.5
# If move animation is OFF, and stop animation is ON
elsif @step_anime
# Increase animation count by 1
@anime_count += 1
end
end
end
#==============================================================================
# ** Game_Player
#------------------------------------------------------------------------------
# This class handles the player. Its functions include event starting
# determinants and map scrolling. Refer to "$game_player" for the one
# instance of this class.
#==============================================================================
class Game_Player < Game_Character
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
alias glitchfinder_classic_screensize_initialize initialize
def initialize
glitchfinder_classic_screensize_initialize
@size = Screen_Data::Screen_Data[4].to_s.to_f
@width = Screen_Data::Screen_Data[0].to_s.to_i
@height = Screen_Data::Screen_Data[1].to_s.to_i
end
#--------------------------------------------------------------------------
# * Set Map Display Position to Center of Screen
#--------------------------------------------------------------------------
def center(x, y)
max_x = ($game_map.width - @width) * (64 * @size).to_i
max_y = ($game_map.height - @height) * (64 * @size).to_i
$game_map.display_x = [0,
[x * (64 * @size).to_i - @center_x, max_x].min].max
$game_map.display_y = [0,
[y * (64 * @size).to_i - @center_y, max_y].min].max
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
# Remember whether or not moving in local variables
last_moving = moving?
# If moving, event running, move route forcing, and message window
# display are all not occurring
unless moving? or $game_system.map_interpreter.running? or
@move_route_forcing or $game_temp.message_window_showing
# Move player in the direction the directional button is being pressed
case Input.dir4
when 2
move_down
when 4
move_left
when 6
move_right
when 8
move_up
end
end
# Remember coordinates in local variables
last_real_x = @real_x
last_real_y = @real_y
super
# If character moves down and is positioned lower than the center
# of the screen
if @real_y > last_real_y and @real_y - $game_map.display_y > @center_y
# Scroll map down
$game_map.scroll_down(@real_y - last_real_y)
end
# If character moves left and is positioned more let on-screen than
# center
if @real_x < last_real_x and @real_x - $game_map.display_x < @center_x
# Scroll map left
$game_map.scroll_left(last_real_x - @real_x)
end
# If character moves right and is positioned more right on-screen than
# center
if @real_x > last_real_x and @real_x - $game_map.display_x > @center_x
# Scroll map right
$game_map.scroll_right(@real_x - last_real_x)
end
# If character moves up and is positioned higher than the center
# of the screen
if @real_y < last_real_y and @real_y - $game_map.display_y < @center_y
# Scroll map up
$game_map.scroll_up(last_real_y - @real_y)
end
# If not moving
unless moving?
# If player was moving last time
if last_moving
# Event determinant is via touch of same position event
result = check_event_trigger_here([1,2])
# If event which started does not exist
if result == false
# Disregard if debug mode is ON and ctrl key was pressed
unless $DEBUG and Input.press?(Input::CTRL)
# Encounter countdown
if @encounter_count > 0
@encounter_count -= 1
end
end
end
end
# If C button was pressed
if Input.trigger?(Input::C)
# Same position and front event determinant
check_event_trigger_here([0])
check_event_trigger_there([0,1,2])
end
end
end
end
#==============================================================================
# ** Sprite_Character
#------------------------------------------------------------------------------
# This sprite is used to display the character. It observes the Game_Character
# class and automatically changes sprite conditions.
#==============================================================================
class Sprite_Character < RPG::Sprite
#--------------------------------------------------------------------------
# * Object Initialization
# viewport : viewport
# character : character (Game_Character)
#--------------------------------------------------------------------------
def initialize(viewport, character = nil)
@size = Screen_Data::Screen_Data[4].to_s.to_f
@current_size = 2
super(viewport)
@character = character
update
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
super
# If tile ID, file name, or hue are different from current ones
if @tile_id != @character.tile_id or
@character_name != @character.character_name or
@character_hue != @character.character_hue
# Remember tile ID, file name, and hue
@tile_id = @character.tile_id
@character_name = @character.character_name
@character_hue = @character.character_hue
# If tile ID value is valid
if @tile_id >= 384
self.bitmap = RPG::Cache.tile($game_map.tileset_name,
@tile_id, @character.character_hue)
self.src_rect.set(0, 0, 32, 32)
self.ox = (8 * ((@size * 2) - 2)).to_i
self.oy = (64 * (1 / @size)).to_i
# If tile ID value is invalid
else
self.bitmap = RPG::Cache.character(@character.character_name,
@character.character_hue)
@cw = bitmap.width / 4
@ch = bitmap.height / 4
self.ox = (@cw / 2) - ((8 * ((@size * 2) - 4) * -1).to_i)
self.oy = @ch + ((16 * ((@size * 2) - 4) * -1).to_i)
end
end
# Set visible situation
self.visible = (not @character.transparent)
# If graphic is character
if @tile_id == 0
# Set rectangular transfer
sx = @character.pattern * @cw
sy = (@character.direction - 2) / 2 * @ch
self.src_rect.set(sx, sy, @cw, @ch)
end
# Set sprite coordinates
self.x = @character.screen_x
self.y = @character.screen_y
self.z = @character.screen_z(@ch)
# Set opacity level, blend method, and bush depth
self.opacity = @character.opacity
self.blend_type = @character.blend_type
self.bush_depth = @character.bush_depth
# Animation
if @character.animation_id != 0
animation = $data_animations[@character.animation_id]
animation(animation, true)
@character.animation_id = 0
end
if @current_size != @size
@zoom = (0.50 * @size.to_f)
self.zoom_x = @zoom
self.zoom_y = @zoom
x = @character.screen_x
x = x * @zoom
y = @character.screen_y
y = y * @zoom
self.x = x
self.y = y
@current_size = @size
end
end
end
#==============================================================================
# ** Spriteset_Map
#------------------------------------------------------------------------------
# This class brings together map screen sprites, tilemaps, etc.
# It's used within the Scene_Map class.
#==============================================================================
class Spriteset_Map
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
alias glitchfinder_classic_screensize_initialize initialize
def initialize
glitchfinder_classic_screensize_initialize
width = size = Screen_Data::Screen_Data[2].to_s.to_f
height = size = Screen_Data::Screen_Data[3].to_s.to_f
size = Screen_Data::Screen_Data[4].to_s.to_f
@viewport1 = Viewport.new(0, 0, (width * size).to_i, (height * size).to_i)
@viewport2 = Viewport.new(0, 0, (width * size).to_i, (height * size).to_i)
@viewport3 = Viewport.new(0, 0, (width * size).to_i, (height * size).to_i)
@viewport2.z = 200
@viewport3.z = 5000
# Make tilemap
@tilemap = Tilemap.new(@viewport1)
@tilemap.tileset = RPG::Cache.tileset($game_map.tileset_name)
for i in 0..6
autotile_name = $game_map.autotile_names[i]
@tilemap.autotiles[i] = RPG::Cache.autotile(autotile_name)
end
@tilemap.map_data = $game_map.data
@tilemap.priorities = $game_map.priorities
# Make panorama plane
@panorama = Plane.new(@viewport1)
@panorama.z = -1000
# Make fog plane
@fog = Plane.new(@viewport1)
@fog.z = 3000
# Make character sprites
@character_sprites = []
for i in $game_map.events.keys.sort
sprite = Sprite_Character.new(@viewport1, $game_map.events[i])
@character_sprites.push(sprite)
end
@character_sprites.push(Sprite_Character.new(@viewport1, $game_player))
# Make weather
@weather = RPG::Weather.new(@viewport1)
# Make picture sprites
@picture_sprites = []
for i in 1..50
@picture_sprites.push(Sprite_Picture.new(@viewport2,
$game_screen.pictures[i]))
end
# Make timer sprite
@timer_sprite = Sprite_Timer.new
# Frame update
update
end
end
#==============================================================================
# ** Screen_Resizer
#------------------------------------------------------------------------------
# This will begin the screen size change.
#==============================================================================
begin
width = Screen_Data::Screen_Data[0].to_s.to_i
height = Screen_Data::Screen_Data[1].to_s.to_i
window = Screen_Size.new
window = window.change_screen_size(width, height)
end
Если не сработает, я перекину тебе через аську другой скрипт, правда я не сильно в них разбираюсь.
|