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.

Tile "Pictures" Ingame

I need a scene that tiles 6 pictures from the pictures folder on one screen and when you press cancel it closes the scene. So it's laid out like this:
http://img230.imageshack.us/img230/5964 ... ncewp3.png[/img]
They need to be resized to 160x120 like those red rectangles in the image with spacing in between just like in the image. At the bottom there is no window skin it just says Press Cancel to Exit in the centre.
And you call the scene like you would with any other scene in an event.
(And the background for the scene needs to be a panorama)
 
It needs to be 0-6 pictures with any name, if I use events then the pictures have to be specific names.
Oh yes, and I might need an "Import Picture" option, where you type the location of the picture in a box and it'll copy it into the pictures folder. This is for a photo album style thing.
In theory it should be quite simple to set up the scene itself, but there might be difficulty with an import option and the resize.
 
OK, I'll create this, but... pictures will be thumbnails? so when you click them, a bigger picture will appear ?

it's done :)
Code:
#==============================================================================
# ** el felixio's Gallery
#------------------------------------------------------------------------------
# by Slipknot (http://www.rmxp.org/forums)
#==============================================================================

class Game_System
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor :gallery_pictures
  #--------------------------------------------------------------------------
  # * Alias
  #--------------------------------------------------------------------------
  alias slipknot_elfelixiogallery_init initialize
  #--------------------------------------------------------------------------
  # * Initialize
  #--------------------------------------------------------------------------
  def initialize
    slipknot_elfelixiogallery_init
    @gallery_pictures = []
  end
end


class Scene_Gallery
  #--------------------------------------------------------------------------
  # * Main
  #--------------------------------------------------------------------------
  def main
    @back = Sprite.new()
    @back.picture = RPG::Cache.panorama('gallery')
    @cancel = Sprite.new
    @cancel.y = 320
    @cancel.bitmap = Bitmap.new(640, 160)
    @cancel.bitmap.draw_text(0, 0, 640, 160, 'Press Cancel to Exit', 1)
    @sprites = Array.new(6, nil)
    $game_system.gallery_pictures.each_index do |i|
      @sprites[i] = Sprite.new
      @sprites[i].x, @sprites[i].y = i % 3 * 240, i / 3 * 160
      @sprites[i].bitmap = RPG::Cache.picture($game_system.gallery_pictures[i])
    end
    Graphics.transition
    until Input.trigger?(Input::B)
      Graphics.update
      Input.update
    end
    $scene = Scene_Map.new
    Graphics.freeze
    @sprites.each { |x| x.dispose }
    @cancel.dispose
    @back.dispose
  end
end

To call it and set the pictures, use this:
Code:
$game_system.gallery_pictures = [
  'elfelixio',
  'elfelixio',
  'elfelixio',
  'elfelixio',
  'elfelixio',
  'elfelixio'
]
$scene = Scene_Gallery.new
 
...I don't trust that "Script". Just reading it I can see it won't do what I want to do.
No mouse input and no big pictures when you click on the thumbnails.
Is this harder than I thought? :(
 
el felixio;189106 said:
...I don't trust that "Script". Just reading it I can see it won't do what I want to do.
No mouse input and no big pictures when you click on the thumbnails.
Is this harder than I thought? :(
You never said something about a mouse and the thumbnails... O_o
 

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