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.

[RESOLVED] Image Not Displaying

Status
Not open for further replies.

Mac

Member

Instead of setting the picture to the page and having to do the image on a 640 x 480 canvas i though it would be soo much easier and beneficial to do it like this, but for some reason the image doesn't appear. Can anyone help me with this? Thanks

Code:
  def initialize
    super(0, 350, 180, 130)
    self.opacity = 0
    self.contents = Bitmap.new(width - 32, height - 32)
    bitmap = RPG::Cache.picture("Shop Command")
    self.contents.blt(0, 0, bitmap, Rect.new(0, 0, 180, 130))
    @item_max = 3
    @row_max = 3
    @commands = ["Buy", "Sell", "Exit"]
    refresh
    self.index = 0
  end
 
Supposing you´re using a class that´s inheriting from Window_Command... Add this method:
Code:
  def refresh
    self.contents.clear
    bitmap = RPG::Cache.picture("Shop Command")
    self.contents.blt(0, 0, bitmap, Rect.new(0, 0, 180, 130))
    for i in 0...@item_max
      draw_item(i, normal_color)
    end
  end
Also, change this:
Code:
super(0, 350, 180, 130)
By this:
Code:
super(0, 350, 212, 162)
To avoid your grapics to be cutted off.
 
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