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.

Show an image in all scenes?

How can I make it so that an image shows in all scenes?

Like er...

@frame = Sprite.new
@frame.bitmap = RPG::Cache.picture('frames01')

/\ But show on every scene, including map, menu, battle, everything.

Edit:

Also

Is it possible to do something like this with the above:

if scene is Scene_Map, @frame.bitmap = RPG::Cache.picture('frame2')
else, @frame.bitmap = RPG::Cache.picture('frame')

....if so, where would I put this?
 
I personally wouldn't recommend that.

What would be best would be make all class have a parent class and go that route (such as a Scene_Base).

My next suggestion would to be go into Main.

Code:
  while $scene != nil
    $scene.main
  end

Instead, change it with this:

Code:
  @sprite = Sprite.new
  while $scene != nil
    filename = $scene.is_a?(Scene_Map) ? 'Map Pic' : 'Other Pic'
    @sprite.bitmap = RPG::Cache.picture( filename )
    $scene.main
  end
  @sprite.dispose

That should do the trick.
 
Hmm... I tried this;

Code:
  @sprite = Sprite.new
  @frame = Sprite.new
  while $scene != nil
    filename = $scene.is_a?(Scene_Map) ? 'backddd' : 'backddd2'
    @sprite.bitmap = RPG::Cache.picture(filename)
    @sprite.y = 640
    @frame.bitmap = RPG::Cache.picture('HUDA')
    @frame.z = 9999
    $scene.main
  end
  @sprite.dispose
  @frame.dispose

The @frame picture shows fine, but the @sprite picture doesn't show at all.

Edit: Resolution fix script made it 750 pix wide, that's why it is y = 640.
 
Wyatt;109584 said:
Hmm, it works at 5000. Strange...

I'm not sure if this is the cause, but in Spriteset_Map, the Z value for @viewport3 (for screen effects such as flashes, etc. apparently) is 5000.

I usually set a sprite's z-coordinate to ridiculous values (> 10000) if I want it to stay on the top layer, but that's just me.
 

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