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.

Windowskin for picture

Do you necessarily need a script?  You could just put the border that you want around the picture manually.  Just an alternative because I can't make a script myself.  Anyhow, I think this should be fairly easy to do in script.  Good luck!
 
Try this....

Code:
#-------------------------------------------------------------------------------
#
# Picture Window  -  Use to display a picture in a window frame
#
# In an event 'Script' command, enter $pf = Picture_Window.new("Pic_Name")
# Use $pf.dispose to erase the picture
#
# You can also set a different window skin below, or comment the line to
# use the default windowskin
#
# Brew - 11MAR08
#-------------------------------------------------------------------------------

class Picture_Window < Window_Base
  def initialize(picture)
    super(0, 0, 160, 64)
    #---------------------------------------
    # Enter your custom windowskin name here
    # Or comment this line to use the default
    #
    self.windowskin = RPG::Cache.windowskin("wstemplate")
    #
    #---------------------------------------
    self.contents = Bitmap.new("Graphics\\Pictures\\" + picture)
    self.width = self.contents.width + 32
    self.height = self.contents.height + 32
    self.x = (640 - self.width) / 2
    self.y = (480 - self.height) / 2
  end
end

Paste it in a new script right above main.
I would recommend creating a custom windowskin with a 16 pixel border, since the default windowskin leaves a 16 pix space around the picture.
The window will automatically size to the picture.

Be Well
 

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