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.

Some functions in RGSS2's Graphics for RGSS1

poccil

Sponsor

The following module I wrote is an adaptation of some of the methods in RGSS2's Graphics module for the RGSS Player version 1.  I hope this is of use.  It is released to the public domain.

Code:
module Graphics
  @@fadeoutvp=Viewport.new(0,0,640,480)
  @@fadeoutvp.z=0x3FFFFFFF
  @@fadeoutvp.color=Color.new(0,0,0,0)
  def self.brightness
    return (255-@@fadeoutvp.color.alpha)
  end
  def self.brightness=(value)
    value=0 if value<0
    value=255 if value>255
    @@fadeoutvp.color.alpha=255-value
  end
  def self.fadein(frames)
    return if frames<=0
    curvalue=self.brightness
    count=(255-self.brightness)
    frames.times do |i|
      self.brightness=curvalue+(count*i/frames)
      self.update
    end
  end
  def self.wait(frames)
    return if frames<=0
    frames.times do |i|
      self.update
    end
  end
  def self.fadeout(frames)
    return if frames<=0
    curvalue=self.brightness
    count=self.brightness
    frames.times do |i|
      self.brightness=curvalue-(count*i/frames)
      self.update
    end
  end
end
 

Jason

Awesome Bro

So this allows us to use some RGSS2 scripts in our XP games ? Sorry if I'm wrong but I don't really understand these things, lol.
 
No -_-

This script recreates some of the methods from RGSS2, specifically from the Graphics class (fade in, wait, fade out, brightness)
 
That's cool, well done poccil! I'm already using RGSS2 with RMXP but with my method, you need a new tilemap class, all the RPG classes in your script, etc.

Keep up the good work!
 

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