Module: Graphics
- Defined in:
- lib/rgss3/graphics.rb
Class Attribute Summary collapse
-
.brightness ⇒ Object
Returns the value of attribute brightness.
-
.frame_count ⇒ Object
Returns the value of attribute frame_count.
-
.frame_rate ⇒ Object
Returns the value of attribute frame_rate.
-
.gosu_window ⇒ Object
readonly
Returns the value of attribute gosu_window.
Class Method Summary collapse
- .add_container(container) ⇒ Object
- .draw ⇒ Object
- .fadein(duration) ⇒ Object
- .fadeout(duration) ⇒ Object
- .frame_reset ⇒ Object
- .freeze ⇒ Object
- .fullscreen? ⇒ Boolean
- .height ⇒ Object
- .play_movie(filename) ⇒ Object
-
.reform_window(w, h, f, update_interval) ⇒ Object
def self.set_fullscreen(bool) return if bool == fullscreen? reform_window(width, height, bool, gosu_window.update_interval) end.
- .remove_container(container) ⇒ Object
- .resize_screen(w, h) ⇒ Object
- .snap_to_bitmap ⇒ Object
- .transition(duration = 10, filename = "", vague = 40) ⇒ Object
- .update ⇒ Object
- .wait(duration) ⇒ Object
- .width ⇒ Object
Class Attribute Details
.brightness ⇒ Object
Returns the value of attribute brightness.
9 10 11 |
# File 'lib/rgss3/graphics.rb', line 9 def brightness @brightness end |
.frame_count ⇒ Object
Returns the value of attribute frame_count.
7 8 9 |
# File 'lib/rgss3/graphics.rb', line 7 def frame_count @frame_count end |
.frame_rate ⇒ Object
Returns the value of attribute frame_rate.
9 10 11 |
# File 'lib/rgss3/graphics.rb', line 9 def frame_rate @frame_rate end |
.gosu_window ⇒ Object (readonly)
Returns the value of attribute gosu_window.
8 9 10 |
# File 'lib/rgss3/graphics.rb', line 8 def gosu_window @gosu_window end |
Class Method Details
.add_container(container) ⇒ Object
107 108 109 |
# File 'lib/rgss3/graphics.rb', line 107 def self.add_container(container) @containers.add(container) end |
.draw ⇒ Object
119 120 121 122 123 124 125 |
# File 'lib/rgss3/graphics.rb', line 119 def self.draw if @latest @latest.draw(0, 0, 0) c = @draw_color RGSS3.window.draw_quad(0, 0, c, 0, height, c, width, 0, c, width, height, c, 1) end end |
.fadein(duration) ⇒ Object
63 64 65 66 67 68 69 70 71 72 |
# File 'lib/rgss3/graphics.rb', line 63 def self.fadein(duration) # Thread.new { # rate = 255 / duration.to_f # until @brightness >= 255 # self.brightness += rate # sleep 1.0 / frame_rate # end # self.brightness = 255 # } end |
.fadeout(duration) ⇒ Object
52 53 54 55 56 57 58 59 60 61 |
# File 'lib/rgss3/graphics.rb', line 52 def self.fadeout(duration) # Thread.new { # rate = @brightness / duration.to_f # until @brightness <= 0 # self.brightness -= rate # sleep 1.0 / frame_rate # end # self.brightness = 0 # } end |
.frame_reset ⇒ Object
87 88 89 |
# File 'lib/rgss3/graphics.rb', line 87 def self.frame_reset # AT A LOSS ON HOW TO INTEGRATE end |
.freeze ⇒ Object
74 75 76 |
# File 'lib/rgss3/graphics.rb', line 74 def self.freeze @frozen = true end |
.fullscreen? ⇒ Boolean
115 116 117 |
# File 'lib/rgss3/graphics.rb', line 115 def self.fullscreen? RGSS3.window.fullscreen? end |
.height ⇒ Object
95 96 97 |
# File 'lib/rgss3/graphics.rb', line 95 def self.height RGSS3.window.height end |
.play_movie(filename) ⇒ Object
103 104 105 |
# File 'lib/rgss3/graphics.rb', line 103 def self.play_movie(filename) # LIKELY TO REMAIN UNINTEGRATED end |
.reform_window(w, h, f, update_interval) ⇒ Object
def self.set_fullscreen(bool)
return if bool == fullscreen?
reform_window(width, height, bool, gosu_window.update_interval)
end
132 133 134 135 136 |
# File 'lib/rgss3/graphics.rb', line 132 def self.reform_window(w, h, f, update_interval) # Graphics.gosu_window.close # Graphics.gosu_window = GosuGame.new(w, h, f, update_interval) # Graphics.gosu_window.show end |
.remove_container(container) ⇒ Object
111 112 113 |
# File 'lib/rgss3/graphics.rb', line 111 def self.remove_container(container) @containers.delete(container) end |
.resize_screen(w, h) ⇒ Object
99 100 101 |
# File 'lib/rgss3/graphics.rb', line 99 def self.resize_screen(w, h) reform_window(w, h, fullscreen?, RGSS3.update_interval) end |
.snap_to_bitmap ⇒ Object
83 84 85 |
# File 'lib/rgss3/graphics.rb', line 83 def self.snap_to_bitmap Bitmap.from_gosu(@current) end |
.transition(duration = 10, filename = "", vague = 40) ⇒ Object
78 79 80 81 |
# File 'lib/rgss3/graphics.rb', line 78 def self.transition(duration = 10, filename = "", vague = 40) @frozen = false # VAGUE ELUDES ME AS TO HOW TO INTEGRATE end |
.update ⇒ Object
38 39 40 41 42 43 44 45 46 |
# File 'lib/rgss3/graphics.rb', line 38 def self.update window = RGSS3.window @current = window.record(window.width, window.height) do @containers.each(&:draw) end @frame_count += 1 @latest = @current unless @frozen Fiber.yield end |
.wait(duration) ⇒ Object
48 49 50 |
# File 'lib/rgss3/graphics.rb', line 48 def self.wait(duration) duration.times { update } end |
.width ⇒ Object
91 92 93 |
# File 'lib/rgss3/graphics.rb', line 91 def self.width RGSS3.window.width end |