Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

SPRITE RESIZE

hey iwas wondering if it was possible to resize your character through the sprite_ class? and if possibly to have a gamevariable to determine what size the character should be
 

Anonymous

Guest

This only works without the SDK(I think), but here goes:
go into the Spriteset_Map class and change this line:
Code:
@character_sprites.push(Sprite_Character.new(@viewport1, $game_player))
to
Code:
@player_sprite = (Sprite_Character.new(@viewport1, $game_player))
.

now, under the line
Code:
def dispose
add the line
Code:
@player_sprite.dispose
and under the line
Code:
def update
add the line
Code:
@player_sprite.update


Next, go to line 89, press enter, and insert the code:
Code:
if @player_sprite.zoom_x != $game_variables[x]
  @player_sprite.zoom_x = $game_variables[x].to_f / 100
end
if @player_sprite.zoom_y != $game_variables[y]
  @player_sprite.zoom_y = $game_variables[y].to_f / 100
end
if $game_variables[x] == 0
  @player_sprite.zoom_x = 1.0
end
if $game_variables[y] == 0
  @player_sprite.zoom_y = 1.0
end
And there you have it!

P.S. to change the variables used in zoom, go to the lines
Code:
if @player_sprite.zoom_x != $game_variables[x]
if @player_sprite.zoom_y != $game_variables[y]
if $game_variables[x] == 0
if $game_variables[y] == 0

and change x and y to the variables for the X Zoom and Y Zoom.
100 is normel, 50 is half, and 200 is double. I've also made it so that a zoom of 0 equals 100. Hope that helps!
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top