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.

Another quickie

with a Window, using the syntax
self.contents = Bitmap.new(filename)

What exactly is the filename?
Say i had a it in Project1\Graphics\Windows\image.png. What would I put for filename?
 
Well if you look at RPG::Cache in the help file under def load_bitmap, you will see :

Code:
    def self.load_bitmap(folder_name, filename, hue = 0)
      path = folder_name + filename
      if not @cache.include?(path) or @cache[path].disposed?
        if filename != ""
          @cache[path] = Bitmap.new(path)

So basically, it would be something like:
Code:
self.contents = Bitmap.new('Graphics/<folder_name>/<image_name_with_no_extensions>')

However, don't use this method. The RPG::Cache holds a cache of loaded bitmaps. Istead of reloading the same bitmap over and over again, it is better to use the RPG::Cache to load bitmaps (think of it as a memory. don't learn 2 + 2 again, memorize it)

self.contents = RPG::Cache.picture('filename')

something like that.
 
Thanks, I'll try that instead. My CMS is an edit of Catchm's FFX-2 CMS in which you loads pictures into the background and makes windows opaque to make it seem like the picture is the window... which really complicates menu animations.

So I want to make the picture the contents off the window so it actually moves with the window's x and y.
 

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