Script zoom char, increse or reduce chara size

Zoom char VXVersion: 0.5
By: Falcao

Introduction

Here i bring you a script that allow you to increase or reduce the characters size

Screenshots

Image

RPG Maker VX script

Content Hidden Spoiler
  1.  
  2. #==================================================================#
  3. #  #*****************#         Zoom char V 0.5 , Falcao script     #
  4. #  #*** By Falcao ***#         allow you to increse the chara size #                  
  5. #  #*****************#         making zoom effect.                 #
  6. #         RMVX                                                     #
  7. # makerpalace.onlinegoo.com                                        #
  8. #==================================================================#
  9.  
  10. #-------------------------------------------------------------------
  11. # * Commands
  12. #
  13. # $game_player.zoom(x,y)      player zoom command,
  14. # Example.  $game_player.zoom(2,2) increase double
  15. #
  16. # $game_map.events[Event ID].zoom(x,y)   event zoom command  
  17. # Example  $game_map.events[1].zoom(2,2)  event ID 1 increase double
  18. #
  19. # Note: Zoom support decimals
  20. # Default zoom for each character is "(1,1)"
  21. #--------------------------------------------------------------------
  22.  
  23. class Game_Character
  24.   attr_accessor :zoom_x
  25.   attr_accessor :zoom_y
  26.   alias falcaozoom_ini initialize
  27.   def initialize
  28.     falcaozoom_ini
  29.     @zoom_x = 1.0
  30.     @zoom_y = 1.0
  31.   end
  32.   def zoom(x,y)
  33.     self.zoom_x = x
  34.     self.zoom_y = y
  35.   end
  36. end
  37.  
  38. class Sprite_Character < Sprite_Base
  39. alias character_zoom_update update
  40.  def update
  41.      character_zoom_update
  42.      if @zoom_x != @character.zoom_x or
  43.         @zoom_y != @character.zoom_y
  44.         @zoom_x = @character.zoom_x
  45.         @zoom_y = @character.zoom_y      
  46.         self.zoom_x = @character.zoom_x
  47.         self.zoom_y = @character.zoom_y
  48.      end  
  49.  end
  50. end
  51.  
  52. class Game_Player < Game_Character
  53.   def zoom(x,y)
  54.     self.zoom_x = x
  55.     self.zoom_y = y
  56.   end
  57. end
  58.  
  59.  
Expand to see the code.


RPG Maker XP script

Content Hidden Spoiler
  1.  
  2. #==================================================================#
  3. #  #*****************#         Zoom char V 0.5 , Falcao script     #
  4. #  #*** By Falcao ***#         allow you to increse the chara size #                  
  5. #  #*****************#         making zoom effect.                 #
  6. #         RMXP                                                     #
  7. # makerpalace.onlinegoo.com                                        #
  8. #==================================================================#
  9.  
  10. #-------------------------------------------------------------------
  11. # * Commands
  12. #
  13. # $game_player.zoom(x,y)      player zoom command,
  14. # Example.  $game_player.zoom(2,2) increase double
  15. #
  16. # $game_map.events[Event ID].zoom(x,y)   event zoom command  
  17. # Example  $game_map.events[1].zoom(2,2)  event ID 1 increase double
  18. #
  19. # Note: Zoom support decimals
  20. # Default zoom for each character is "(1,1)"
  21. #--------------------------------------------------------------------
  22.  
  23. class Game_Character
  24.   attr_accessor :zoom_x
  25.   attr_accessor :zoom_y
  26.   alias falcaozoom_ini initialize
  27.   def initialize
  28.     falcaozoom_ini
  29.     @zoom_x = 1.0
  30.     @zoom_y = 1.0
  31.   end
  32.   def zoom(x,y)
  33.     self.zoom_x = x
  34.     self.zoom_y = y
  35.     if self.is_a?(Game_Player)
  36.       self.zoom_x = x
  37.       self.zoom_y = y
  38.     end
  39.   end
  40. end
  41.  
  42. class Sprite_Character < RPG::Sprite
  43. alias character_zoom_update update
  44.  def update
  45.      character_zoom_update
  46.      if @zoom_x != @character.zoom_x or
  47.         @zoom_y != @character.zoom_y
  48.         @zoom_x = @character.zoom_x
  49.         @zoom_y = @character.zoom_y      
  50.         self.zoom_x = @character.zoom_x
  51.         self.zoom_y = @character.zoom_y
  52.      end  
  53.  end
  54. end
  55.  
Expand to see the code.


Instructions

Copy and paste the script to your project and call the script using the following commands

$game_player.zoom(x,y) player zoom command,
Example. $game_player.zoom(2,2) increase double

$game_map.events[Event ID].zoom(x,y) event zoom command
Example $game_map.events[1].zoom(2,2) event ID 1 increase double

Note: Zoom support decimals
Default zoom for each character is "(1,1)"

Compatibility

Sprite_Character aliased

Credits and Thanks

By Falcao

Author's Notes

Enjoy

Terms and Conditions

This script can be posted in every forums but you have to give credits to the author
Can the character be reduced smaller than 1,1? .5 for example?

Also: Any way to make this RMXP friendly?
This could be really handy for me, however, I'm using XP sadly :sad:

Do you think there's a possibility of you making this compatible with XP too ? :angel:
jъГìsт wrote:
This could be really handy for me, however, I'm using XP sadly :sad:

Do you think there's a possibility of you making this compatible with XP too ? :angel:



Ok, i update the post and now we have both RMVX and RMXP script!!!

Enjoy
I hope you realize that both of these scripts have redundant code. Specifically, the repetition involving the zoom method. If you have it in Game_Character, you have no need to insert an identical method in Game_Player. Another tidbit of information is that you have no need to check to see if the character is indeed an instance of Game_Player when you set the zoom_x and zoom_y in RMXP. In fact, the two lines prior to that check will be sufficient. (Especially considering the fact that if the check proves true, all it does is repeat those two lines all over again)
falcao wrote:
jъГìsт wrote:
This could be really handy for me, however, I'm using XP sadly :sad:

Do you think there's a possibility of you making this compatible with XP too ? :angel:



Ok, i update the post and now we have both RMVX and RMXP script!!!

Enjoy


Ah thanks for that, it'll make my life alot easier.

And Glitch, care to post the scripts without the redundant code ? (Unless falcao does it first)
jъГìsт wrote:
Ah thanks for that, it'll make my life alot easier.

And Glitch, care to post the scripts without the redundant code ? (Unless falcao does it first)


Actually, it's an easy enough fix that you can do it. In the XP version, you want to remove lines 35-38 (the if statement), while in the VX version you can remove lines 52-57. (The entire modification to Game_Player)
Meh, why didn't I think of just doing that myself (Now I look over it again, it looks obvious, lol)... maybe it's cause I'm tired and everything is blurry...
Hmm, I got "Syntax error occurred while running script" after using the script in an event to shrink the charset to (.5,.5) with the XP version.

Can we not go below (1,1)?
You must use 0.5 instead of .5.
Doh! That should have been obvious!
Thanks Daniel!


This script is wonderful, and so easy to use!

Saves me from making worldmap charsets for every character, while at the same time resolving an issue I was having with my save file menu! WooHoo!

Original thread: https://www.hbgames.org/forums/viewtopic.php?t=67068