PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : RMVX Native Auflösung Skript gesucht



Amuggi
08.01.2013, 15:49
Hallo Community,

ich suche ein suche ein Skript, was es ermöglicht, den sichtbaren Bereich im Spiel an die native Auflösung des Monitors anzupassen.
Das bedeutet, je höher die Auflösung, desto mehr soll man von der Map in einem Bereich sehen können.

Zur Zeit verwende ich dieses Skript:
#======================================================================
#========
# ** TDS Resolution Change[VX]
# Version: 1.8
#------------------------------------------------------------------------------
# This script changes the resolution from the default VX resolution
# of 544 x 416 to 640 x 480 RMXP Resolution
#==============================================================================

#--------------------------------------------------------------------------
# * Graphics - Rezise Screen
#--------------------------------------------------------------------------
Graphics.resize_screen(640, 480)

#==============================================================================
# ▼ Game Objects
#------------------------------------------------------------------------------
# All clases below the Game Objects tab
#==============================================================================

#==============================================================================
# ** Game_Map
#------------------------------------------------------------------------------
# This class handles maps. It includes scrolling and passage determination
# functions. The instance of this class is referenced by $game_map.
#==============================================================================

class Game_Map
#--------------------------------------------------------------------------
# * Scroll Setup
#--------------------------------------------------------------------------
alias tds_vx_resolution_change_setup_scroll setup_scroll
def setup_scroll
tds_vx_resolution_change_setup_scroll
@scroll_direction = 2
@scroll_rest = 0
@scroll_speed = 4
@margin_x = (width - 20) * 256 / 2 # Screen non-display width /2
@margin_y = (height - 15) * 256 / 2 # Screen non-display height /2
end

#--------------------------------------------------------------------------
# * Calculate X coordinate for parallax display
# bitmap : Parallax bitmap
#--------------------------------------------------------------------------
alias tds_vx_resolution_change_calc_parallax_x calc_parallax_x
def calc_parallax_x(bitmap)
tds_vx_resolution_change_calc_parallax_x(bitmap)
if bitmap == nil
return 0
elsif @parallax_loop_x
return @parallax_x / 16
elsif loop_horizontal?
return 0
else
w1 = bitmap.width - 640
w2 = @map.width * 32 - 640
if w1 <= 0 or w2 <= 0
return 0
else
return @parallax_x * w1 / w2 / 8
end
end
end

#--------------------------------------------------------------------------
# * Calculate Y coordinate for parallax display
# bitmap : Parallax bitmap
#--------------------------------------------------------------------------
alias tds_vx_resolution_change_calc_parallax_y calc_parallax_y
def calc_parallax_y(bitmap)
tds_vx_resolution_change_calc_parallax_y(bitmap)
if bitmap == nil
return 0
elsif @parallax_loop_y
return @parallax_y / 16
elsif loop_vertical?
return 0
else
h1 = bitmap.height - 480
h2 = @map.height * 32 - 480
if h1 <= 0 or h2 <= 0
return 0
else
return @parallax_y * h1 / h2 / 8
end
end
end

#--------------------------------------------------------------------------
# * Scroll Down
# distance : scroll distance
# *Note: Could not be aliased because it causes the scrolling to look
# Unnatural
#--------------------------------------------------------------------------
def scroll_down(distance)
if loop_vertical?
@display_y += distance
@display_y %= @map.height * 256
@parallax_y += distance
else
last_y = @display_y
@display_y = [@display_y + distance, (height - 15) * 256].min
@parallax_y += @display_y - last_y
end
end

#--------------------------------------------------------------------------
# * Scroll Right
# distance : scroll distance
# *Note: Could not be aliased because it causes the scrolling to look
# Unnatural
#--------------------------------------------------------------------------
def scroll_right(distance)
if loop_horizontal?
@display_x += distance
@display_x %= @map.width * 256
@parallax_x += distance
else
last_x = @display_x
@display_x = [@display_x + distance, (width - 20) * 256].min
@parallax_x += @display_x - last_x
end
end
end


#==============================================================================
# ** Game_Player
#------------------------------------------------------------------------------
# This class handles maps. It includes event starting determinants and map
# scrolling functions. The instance of this class is referenced by $game_map.
#==============================================================================

class Game_Player < Game_Character
#--------------------------------------------------------------------------
# * Constants
#--------------------------------------------------------------------------
CENTER_X = (640/ 2 - 16) * 8 # Screen center X coordinate * 8
CENTER_Y = (480 / 2 - 16) * 8 # Screen center X coordinate * 8
#--------------------------------------------------------------------------
# * Set Map Display Position to Center of Screen
# x : x-coordinate
# y : y-coordinate
#--------------------------------------------------------------------------
alias tds_vx_resolution_change_center center
def center(x, y)
tds_vx_resolution_change_center(x, y)
display_x = x * 256 - CENTER_X # Calculate coordinates
unless $game_map.loop_horizontal? # No loop horizontally?
max_x = ($game_map.width - 20) * 256 # Calculate max value
display_x = [0, [display_x, max_x].min].max # Adjust coordinates
end
display_y = y * 256 - CENTER_Y # Calculate coordinates
unless $game_map.loop_vertical? # No loop vertically?
max_y = ($game_map.height - 15) * 256 # Calculate max value
display_y = [0, [display_y, max_y].min].max # Adjust coordinates
end
$game_map.set_display_pos(display_x, display_y) # Change map location
end
end


#==============================================================================
# ▼ Sprites
#------------------------------------------------------------------------------
# All clases below the Sprites tab
#==============================================================================

#==============================================================================
# ** Sprite_Base
#------------------------------------------------------------------------------
# A sprite class with animation display processing added.
#==============================================================================
class Sprite_Base < Sprite
#--------------------------------------------------------------------------
# * Start Animation
#--------------------------------------------------------------------------
alias tds_vx_resolution_change_start_animation start_animation
def start_animation(animation, mirror = false)
tds_vx_resolution_change_start_animation(animation, mirror = false)
dispose_animation
@animation = animation
return if @animation == nil
@animation_mirror = mirror
@animation_duration = @animation.frame_max * 4 + 1
load_animation_bitmap
@animation_sprites = []
if @animation.position != 3 or not @@animations.include?(animation)
if @use_sprite
for i in 0..15
sprite = ::Sprite.new(viewport)
sprite.visible = false
@animation_sprites.push(sprite)
end
unless @@animations.include?(animation)
@@animations.push(animation)
end
end
end
if @animation.position == 3
if viewport == nil
@animation_ox = 640 / 2
@animation_oy = 480 / 2
else
@animation_ox = viewport.rect.width / 2
@animation_oy = viewport.rect.height / 2
end
else
@animation_ox = x - ox + width / 2
@animation_oy = y - oy + height / 2
if @animation.position == 0
@animation_oy -= height / 2
elsif @animation.position == 2
@animation_oy += height / 2
end
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
#--------------------------------------------------------------------------
# * Create Viewport
#--------------------------------------------------------------------------
alias tds_vx_resolution_change_create_viewports create_viewports
def create_viewports
tds_vx_resolution_change_create_viewports
@viewport1 = Viewport.new(0, 0, 640, 480)
@viewport2 = Viewport.new(0, 0, 640, 480)
@viewport3 = Viewport.new(0, 0, 640, 480)
@viewport2.z = 50
@viewport3.z = 100
end
end
Mit diesem Skript ist es aber nur mit der Auflösung 640x480 möglich.
Außerdem hätte ich gerne, dass das Spiel die native Auflösung automatisch erkennt und das Spiel sich darauf einstellt.
Ist das möglich?

FlipelyFlip
10.01.2013, 01:40
nicht ohne die .dll des Makers zu bearbeiten. Diese zu bearbeiten, wäre aber gegen die Lizenzvereinbarung von eb! (wenns mich jetz nicht täuscht, ich weiß nur, dass mans nicht darf).
und 640x480 ist die einzige Auflösung die du nicht ohne vergrößerung der Grafik hinkriegst, je weiter raus zu kommst (gibt paar wenige Scripte die das machen), verdoppelt sich auch die größe der angezeigten Grafiken und es wird pixelig (:

also wie gesagt, 640x480 is maximum was der Maker hergibt ohne vergrößerte Grafik.

Amuggi
10.01.2013, 09:57
Ok vergrößerte Grafiken ist sch.....lecht.
Die DLL zu bearbeiten ist auch keine Option, wenn man damit gegen Lizenzbedingungen verstößt.
Dann muss es wohl bei 640x480 bleiben.

Cornix
10.01.2013, 12:29
nicht ohne die .dll des Makers zu bearbeiten. Diese zu bearbeiten, wäre aber gegen die Lizenzvereinbarung von eb! (wenns mich jetz nicht täuscht, ich weiß nur, dass mans nicht darf).
und 640x480 ist die einzige Auflösung die du nicht ohne vergrößerung der Grafik hinkriegst, je weiter raus zu kommst (gibt paar wenige Scripte die das machen), verdoppelt sich auch die größe der angezeigten Grafiken und es wird pixelig (:

also wie gesagt, 640x480 is maximum was der Maker hergibt ohne vergrößerte Grafik.

Das stimmt nicht.
Ich habe ein Script für den RMXP welches ich dir geben kann, ob es problemlos auf dem VX arbeiten wird kann ich dir leider nicht sagen.

Edit: Das Script scheint leider entweder nicht mit dem VX oder nicht mit Windows 7 zu funktionieren.
Hier ist der Code:

module Resolution
#==============================================================================
# Resolution Script
#------------------------------------------------------------------------------
# Script by Selwyn
# Edited by Cornix
# Requires Display.dll
#==============================================================================

title = "\0" * 256
Win32API.new('kernel32', 'GetPrivateProfileString','PPPPLP', 'L').call("Game", "Title", "", title, 256, ".\\Game.ini")
title.delete!("\0")

u = 'user32'
GAME_WINDOW = Win32API.new(u, 'FindWindow', 'PP', 'I').call("RGSS Player", title)

GET_SYSTEM_METRICS = Win32API.new(u, 'GetSystemMetrics', 'I', 'I')
SET_RESOLUTION = Win32API.new('Display.dll', 'SetResolution', 'III', 'I')
SET_WINDOW_LONG = Win32API.new(u, 'SetWindowLong', 'LIL', 'L')
SET_WINDOW_POS = Win32API.new(u, 'SetWindowPos', 'LLIIIII', 'I')

EDGE_WIDTH = 6
EDGE_HEIGHT = 24

module_function

def set_fullscreen(width,height)
SET_WINDOW_LONG.call(GAME_WINDOW, -16, 0x14000000)
SET_WINDOW_POS.call(GAME_WINDOW, -1, 0, 0, width, height, 64)
SET_RESOLUTION.call(width, height, 4)
end

def set_size(width,height)
width += EDGE_WIDTH
height += EDGE_HEIGHT

monitor_width = GET_SYSTEM_METRICS.call(0)
monitor_height = GET_SYSTEM_METRICS.call(1)

x = (monitor_width - width) / 2
y = (monitor_height - height) / 2

SET_WINDOW_LONG.call(GAME_WINDOW, -16, 0x14CA0000)
SET_WINDOW_POS.call(GAME_WINDOW, 0, x, y, width, height, 0)
SET_RESOLUTION.call(monitor_width, monitor_height, 0)
end

end

FlipelyFlip
13.01.2013, 00:38
der Grund warum es nicht klappt ist der, dass da die Display.dll fehlt.
Btw. wenn du dir die Makerhilfe des VX bzw. VX Ace, dann wüsstest du, dass die maximale Größe, die vom Maker supportet wird 640x480 ist.
ausserdem würde das Script zwar das ganze hoch skaliern, aber ebenso die Grafiken vergrößern, da ich da drin im Code bis jetz nix gegen dieses Problem gefunden hab.

lg flipy

edit: hab das orginalscript gefunden: http://save-point.org/thread-2719.html

btw. es macht nix anderes wie ich gesagt habe, es vergrößert dann ebenfalls die Grafik, maximum ist und bleibt 640x480 beim VX und VX Ace. Ohne die direkte Einwirkung in die Engine vom Maker wird sich daran auch nix ändern lassen.

Cornix
13.01.2013, 10:59
der Grund warum es nicht klappt ist der, dass da die Display.dll fehlt.
Btw. wenn du dir die Makerhilfe des VX bzw. VX Ace, dann wüsstest du, dass die maximale Größe, die vom Maker supportet wird 640x480 ist.
ausserdem würde das Script zwar das ganze hoch skaliern, aber ebenso die Grafiken vergrößern, da ich da drin im Code bis jetz nix gegen dieses Problem gefunden hab.

lg flipy

edit: hab das orginalscript gefunden: http://save-point.org/thread-2719.html

btw. es macht nix anderes wie ich gesagt habe, es vergrößert dann ebenfalls die Grafik, maximum ist und bleibt 640x480 beim VX und VX Ace. Ohne die direkte Einwirkung in die Engine vom Maker wird sich daran auch nix ändern lassen.

Hier ist ein Beispiel von der Nutzung des Scripts aus dem RMXP, wie man sehen kann werden die Grafiken nicht mit skaliert.
Das Fenster ist hier 1024*768 Pixel groß.

16508
Die Display.dll braucht man natürlich um das Script zu nutzen.

Allerdings beschränkt der Maker dabei garnichts. Das Script arbeitet direkt mit der Windows API und skaliert einfach das Fenster um welches den passenden Handle benutzt.
Wenn ich schätzen müsste weshalb es bei den neueren Makern nicht funktioniert dann würde ich sagen, liegt dies daran, dass der Fenstername sich anders zusammensetzt und daher ein kleiner Eingriff gemacht werden müsste.

FlipelyFlip
13.01.2013, 13:14
nur weils beim XP das nicht macht, heißt das nicht, dass er es nicht bei den anderen Makern auch macht. Ich habs mitm Orginalscript zum laufen gebracht und siehe da, es vergrößert auch die Grafiken ab 640x480. Teste es doch mal selbst, dann siehste es ja (:

edit:
hier mal der Screen von ner Auflösung bei 800x600
http://www.imagesload.net/img/Resolution%20VX.PNG

edit2:
hier noch mal mit deinem Script und ner Auflösung bei 1024x768 Pixel (:
http://www.imagesload.net/img/Resolution%20dein%20Script.PNG

ich würde ja fast sagen, dass die grafik vergrößert wurde, nicht? ;)

Amuggi
13.01.2013, 17:18
Hallo und danke für die Antworten.
Habe jetzt mal ein bischen mit dem Skript rumprobiert. Das Problem ist, dass das Skript leider immer nur eine "feste" Auflösung unterstüzt.
Ich bräuchte eher etwas, wo sich die Auflösung an den Bildschirm anpasst.
Das Problem mit den vergrößerten Grafiken ist nicht so schlimm.
Habe es in 1920x1080 ausprobiert und bis auf die Schrift war alles noch im grünen Bereich.