Jump to content
Rukiri

Resolution Ace

Recommended Posts

Usage: Resolution.resize(W,H)

Max size is 640,480.

 

Warning:

This does not automatically fix window issues, that's normal. This script only takes care of the main screen, everything else you'll have to script to fit.

 

Screenshots:

142huds.png

 

Script.

 

 

#==============================================================================
# â–  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

 

 

Edited by Rukiri

Share this post


Link to post
Share on other sites

A lot of your code is methods that have not even been changed, could you fix your script so that it shows only what you've changed?

 

Also, I simply use Graphics.resize_screen like Archeia does, and my character scrolls and centers just fine. Not sure why it's not working for you. There are some graphics you'll need to change but that's about it.

Share this post


Link to post
Share on other sites

I already figured this out myself even.

Kinda had to make my own script, cause Yanfly's script conflicted with other scripts i use, cause of features i did not use anyhow.

This is a usful script though, to those wanting to change the resolution without dealing with other features that other scripts that change resolution have.

Edited by Michael Ponder Jr

Share this post


Link to post
Share on other sites

The problem with that is, is that it doesn't update scrolling or centers the player.

 

I tested it before posting it here and it works just fine. Are you sure you don't have some kind of miracle script that does that, like idk, smooth scrolling? I found that something that destroys my camera angle with panorama mapping and character centering.

 

Even as bufkus has reported, it works the same. So I don't see the difference. In fact try using this as double screen reso and see if larger resolutions scroll right. This is something YEA Core fixed.

 

@ponder wtf?

Edited by Archeia Nessiah

Share this post


Link to post
Share on other sites

@ponder wtf?

I was saying YOUR script is useful...

What i say that was so bad and warrented that responce?

I'm sorry, i have trouble some times, conveying what i mean to say..

There are other scripts that do this, one such script is by Yanfly, but it adds other features that tend to cause conflicts with other scripts people might be using.

Your script is great for those who want features for resolution, without the other things, that other scripts include...

It was all meant as a compliment.

 

The first thing i posted was.. just saying i had figured this out already, it was not meant to be insulting or anything... sorry if anything i said was.

Edited by Michael Ponder Jr

Share this post


Link to post
Share on other sites

I am curious how core engine cause conflict with other script but alas I just ended it with a wtf since I'm not in the mood to even talk about it and what might've caused it.

 

And I'm sorry for sounding rude I probably should've said, I don't understand. Than wtf. Sorry :<

Edited by Archeia Nessiah

Share this post


Link to post
Share on other sites

It's alright, i figured i pissed you off, i seem to piss everyone off lately.

Basically his core engine did things that basically just conflicted with other scripts that are not part of his core engine, that's all.

I already had my own script that effected things like, font shadows and outlines, as well as scripts that mess with the guages, and they were not getting along with his core engine, i kept getting error messages, so i looked through his scripts, and picked it apart and learned how to change the few things i wanted changed, really the only reason i used his core was to have the resolution options, so once i learned the commands that adjusted resolution, i stopped using his core.

 

I was also saying your script is great for those wanting to ONLY adjust resolution, and not a mirrid of other things.

Share this post


Link to post
Share on other sites

I think , this script so useless somehow...

But nevermind .

With me this is a wonderful script :X:X:X.

Trying to troll?

Anyway, having a small script provides a feature we need sometime is better than having a large one. Nice job Rukiri.

Share this post


Link to post
Share on other sites

U-um...

 

- No need for the Resolution module. The rewrites are completely unnecessary due to Graphics.resize(width, height).

- Sprite_Timer became off the parent class. It needs to be Sprite_Timer < Sprite.

- Sprite_Timer initialize method is the same. Remove it.

- Sprite_Timer create_bitmap is the same. Remove it.

- Sprite_Timer update is the same. Remove it.

- Sprite_Timer update_position works as is. Remove it.

- Oh wait, there was no need to change the Sprite_Timer class at all.

- Game_Map update no changes were made from the base script. Remove it.

- Game_Map setup_scroll no changes were made from the base script. Remove it.

- Game_Map set_display_pos. if you didn't make that Resolution module and used Graphics.resize(width, height), you wouldn't need this at all.

- Game_Map parallax_ox. if you didn't make that Resolution module and used Graphics.resize(width, height), you wouldn't need this at all

- Game_Map adjust_x. if you didn't make that Resolution module and used Graphics.resize(width, height), you wouldn't need this at all

- Game_Map adjust_y. if you didn't make that Resolution module and used Graphics.resize(width, height), you wouldn't need this at all.

- Game_Map round_x. if you didn't make that Resolution module and used Graphics.resize(width, height), you wouldn't need this at all.

- Game_Map round_y. if you didn't make that Resolution module and used Graphics.resize(width, height), you wouldn't need this at all. How many times was this now? I think I lost count.

- Where are the modifications to Game_Map scroll_down and scroll_right when there's only a mod for scroll_up which isn't needed? Scrolling down and right causes problems with larger resolutions.

- Game_Player center_x. if you didn't make that Resolution module and used Graphics.resize(width, height), you wouldn't need this at all.

- Game_Player center_y. if you didn't make that Resolution module and used Graphics.resize(width, height), you wouldn't need this at all.

- Game_Player center. if you didn't make that Resolution module and used Graphics.resize(width, height), you wouldn't need this at all.

- Game_Player update. Wait, this is the same exact thing from the base script. Remove it.

- Where is the Game_Event near_screen method? That's vital to a changed resolution.

- Window_Base draw_actor_icons doesn't even work anymore because the icons aren't even drawn. Why would you do something like this?

 

The useful changes made from this script... Zero. The negative changes made with this script: no icons drawn, scrolling right and down causes problems with larger resolutions, events aren't automatically calculated if they're near the screen with the changed resolution. And all of this can be done with one line: Graphics.resize(width, height).

Share this post


Link to post
Share on other sites

Really all i had to do for this is place "Graphics.resize_screen 608,480" just above "rgss_main { SceneManager.run }" in main.

And that's all i needed for changing the resolution.

But then i had to manually go back and adjust the placement of some windows, mainly command menues and the gold windows.

Share this post


Link to post
Share on other sites

That's what we're saying all this time 'v'c)

 

Alternatively, you can literally duplicate this script by using Graphics.resize_screen(width, height) in main.

Because the menus, the map, the parallaxes refit by default.

 

The post I made above is an in-depth evaluation of the script.

Edited by Archeia Nessiah

Share this post


Link to post
Share on other sites

Ahhhhhhh, sorry about that, i was a little lost lol

It's as if EB expected people to want to do this. lol

It's a shame they did not just drop the options in like.. a box type thing in the database to be set how ever the developer of a game wants.

But i guess this is just as easy.

I only wish the entire game filled my screen lol

My monitor is 1360 x 768, and the game does not quite fill that space.

I'm left with a BIG black boarder like box thingy lol

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×