module Graphics

Attributes

brightness[R]
frame_count[RW]
frame_rate[R]
needs_redraw[R]

Public Class Methods

add_container(container) click to toggle source
# File lib/rgss3/graphics.rb, line 95
def self.add_container(container)
  @containers.add(container)
end
brightness=(value) click to toggle source
# File lib/rgss3/graphics.rb, line 77
def self.brightness=(value)
  @brightness = [[255, value].min, 0].max
  @draw_color.alpha = 255 - @brightness
end
draw() click to toggle source
# File lib/rgss3/graphics.rb, line 103
def self.draw
  @needs_redraw = false
  @containers.each(&:do_draw)
  if @brightness < 255
    c = @draw_color
    RGSS3.window.draw_quad(0, 0, c, 0, height, c, width, 0, c, width, height, c, 1)
  end
end
fadein(duration) click to toggle source
# File lib/rgss3/graphics.rb, line 36
def self.fadein(duration)
  @brightness = 255
end
fadeout(duration) click to toggle source
# File lib/rgss3/graphics.rb, line 32
def self.fadeout(duration)
  @brightness = 0
end
frame_rate=(value) click to toggle source
# File lib/rgss3/graphics.rb, line 82
def self.frame_rate=(value)
  @frame_rate = [[120, value].min, 10].max
  reform_window(
    width: width,
    height: height,
    fullscreen: RGSS3.window.fullscreen?,
    frame_rate: @frame_rate,
    title: RGSS3.window.caption)
end
frame_reset() click to toggle source
# File lib/rgss3/graphics.rb, line 53
def self.frame_reset
  Fiber.yield
end
freeze() click to toggle source
# File lib/rgss3/graphics.rb, line 40
def self.freeze
  @frozen = true
end
gosu_window() click to toggle source
# File lib/rgss3/graphics.rb, line 69
def self.gosu_window
  RGSS3.window
end
height() click to toggle source
# File lib/rgss3/graphics.rb, line 61
def self.height
  RGSS3.window.height
end
play_movie(filename) click to toggle source
# File lib/rgss3/graphics.rb, line 92
def self.play_movie(filename)
end
reform_window( width: RGSS3.window.width, height: RGSS3.window.height, full_screen: RGSS3.window.fullscreen?, frame_rate: @frame_rate, title: RGSS3.window.caption, rtp: nil) click to toggle source
# File lib/rgss3/graphics.rb, line 112
def self.reform_window(
  width: RGSS3.window.width,
  height: RGSS3.window.height,
  full_screen: RGSS3.window.fullscreen?,
  frame_rate: @frame_rate,
  title: RGSS3.window.caption,
  rtp: nil)

  RGSS3.window.close
  RGSS3.window = RGSS3::GameWindow.new(
    width: width,
    height: height,
    fullscreen: fullscreen,
    frame_rate: frame_rate,
    title: title,
    rtp: rtp)
  RGSS3.window.show
end
remove_container(container) click to toggle source
# File lib/rgss3/graphics.rb, line 99
def self.remove_container(container)
  @containers.delete(container)
end
resize_screen(width, height) click to toggle source
# File lib/rgss3/graphics.rb, line 65
def self.resize_screen(width, height)
  reform_window(width: width, height: height)
end
snap_to_bitmap() click to toggle source
# File lib/rgss3/graphics.rb, line 49
def self.snap_to_bitmap
  Bitmap.new(width, height)
end
transition(duration = 10, filename = "", vague = 40) click to toggle source
# File lib/rgss3/graphics.rb, line 44
def self.transition(duration = 10, filename = "", vague = 40)
  @frozen = false
  @brightness = 255
end
update() click to toggle source
# File lib/rgss3/graphics.rb, line 17
def self.update
  @needs_redraw = true unless @frozen
  @frame_count += 1
  Fiber.yield
end
wait(duration) click to toggle source
# File lib/rgss3/graphics.rb, line 23
def self.wait(duration)
  @needs_redraw = true unless @frozen
  # no need to redraw during wait
  duration.times do
    @frame_count += 1
    Fiber.yield
  end
end
width() click to toggle source
# File lib/rgss3/graphics.rb, line 57
def self.width
  RGSS3.window.width
end