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.

Menu Help

Zero

Member

Hey, I was wondering how I can place an image and some text inside a selection menu.

I know the code for the actual drawing of the text and picture, but I am not sure how to incorporate it into the selection.

Here is my code:
PHP:
lass Scene_Menu
  def initialize (menu_index = 0)
    @menu_index = menu_index
  end
  
#---------------------------------------------------------------------------------

def main
  s1 = "No Entry"
  s2 = "Enter"
  @window = Window_Command.new(200, [s1,s2])
  @window.y=50
  @window.x=440
  @window.height=400
  @window.index = @menu_index

Thanks.
 
You could use this code to show an image:

Code:
bitmap = RPG::Cache.picture("Picture's name")
self.contents.blt(x, y, bitmap, Rect.new(0, 0, bitmap.width, bitmap.height))
 
To call it in the scene try:

Code:
@sprite = Sprite.new
@sprite.bitmap = RPG::Cache.picture("Picture's name")

The code I gave you only works in a Window_Base subclass, sorry.
 

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