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.

Changing zoom of pictures using Call Script?

Status
Not open for further replies.
Unresolved issue in http://www.rmxp.org/forums/showthread.php?t=26174

How do I place what Sir Lord Biowulve posted inside a Call Script and have it fit? I'm so tired of how small the call script box is...I'm sure I'm not the only one...

Code:
$hud = {
"hp" => $game_actors[1].hp * 100 / $game_actors[1].maxhp
"mp" => $game_actors[2].sp * 100 / $game_actors[2].maxsp
}
$game_screen.pictures[ID].move(frames, origin, X, Y, $hud["hp"], height, opacity, blending)

I cant fit this into call script. It causes a syntax error.
 
This is kind of hackish, but I don't see why it wouldn't work.

Go to your script editor and create a new script right above main. Paste this code inside

Code:
class Interpreter
     def move_hud_hp(pic_id, frames, origin, x, y, height, opacity, blending)
          hp = $game_actors[1].hp * 100 / $game_actors[1].maxhp
          $game_screen.pictures[pic_id].move(frames, origin, x, y, hp, height, opacity, blending)
     end
end

Then to call this script, just call

Code:
move_hud_hp(ID, FRAMES, ORIGIN, X, Y, HEIGHT, OPACITY, BLENDING)

This can take up multiple lines, just make sure a comma (or the closing parenthesis) is at the end of a line. Of course, replace the CAPITALs with the correct values.

Basically, what I did was make your call script into a method you can call from events. You can do this with just about anything :)
 
Status
Not open for further replies.

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