Module: Graphics
- Includes:
- FPSAndMouse, GraphicsFPSBalancer, Touch, TouchViewport
- Defined in:
- docs/0_Dependencies.rb,
docs/0_Dependencies.rb,
docs/0_Dependencies.rb
Overview
Module responsive of showing graphics into the main window
Defined Under Namespace
Modules: FPSAndMouse, GraphicsFPSBalancer, Touch, TouchViewport Classes: FPSBalancer
Constant Summary collapse
- TRANSITION_FRAG_SHADER =
Shader used to perform transition
"uniform float param;\nuniform sampler2D texture;\nuniform sampler2D transition;\nuniform sampler2D nextFrame;\nconst float sensibilite = 0.05;\nconst float scale = 1.0 + sensibilite;\nvoid main()\n{\n vec4 frag = texture2D(texture, gl_TexCoord[0].xy);\n vec4 tran = texture2D(transition, gl_TexCoord[0].xy);\n float pixel = max(max(tran.r, tran.g), tran.b);\n pixel -= (param * scale);\n if(pixel < sensibilite)\n {\n vec4 nextFrag = texture2D(nextFrame, gl_TexCoord[0].xy);\n frag = mix(frag, nextFrag, max(0.0, sensibilite + pixel / sensibilite));\n }\n gl_FragColor = frag;\n}\n"- STATIC_TRANSITION_FRAG_SHADER =
Shader used to perform static transition
"uniform float param;\nuniform sampler2D texture;\nuniform sampler2D nextFrame;\nvoid main()\n{\n vec4 frag = texture2D(texture, gl_TexCoord[0].xy);\n vec4 nextFrag = texture2D(nextFrame, gl_TexCoord[0].xy);\n frag = mix(frag, nextFrag, max(0.0, param));\n gl_FragColor = frag;\n}\n"
Class Attribute Summary collapse
-
.current_time ⇒ Time
readonly
Get the current time.
-
.frame_count ⇒ Integer
Get the global frame count.
-
.frame_rate ⇒ Integer
Get the framerate.
-
.fullscreen_toggle_enabled
Tell if it is allowed to go fullscreen with ALT+ENTER.
-
.last_time ⇒ Time
readonly
Get the time when the last frame was executed.
-
.window ⇒ LiteRGSS::DisplayWindow
readonly
Get the game window.
Class Method Summary collapse
-
.brightness ⇒ Integer
Get the brightness of the main game window.
-
.brightness=(brightness)
Set the brightness of the main game window.
-
.delta ⇒ Float
Tell how much time there was since last frame.
-
.focus? ⇒ Boolean
Tell if the graphics window has focus.
-
.frame_reset
Reset frame counter (for FPS reason).
-
.freeze
Freeze the graphics.
-
.frozen? ⇒ Boolean
Tell if the graphics are frozen.
-
.height ⇒ Integer
Get the height of the graphics.
-
.init_sprite
Init the Sprite used by the Graphics module.
-
.load_icon
Load the window icon.
-
.on_start(&block)
Register an event on start of graphics.
-
.original_swap_fullscreen
Swap the fullscreen state.
-
.player_view_screenshot(filename, scale)
Take a screenshot of what's currently displayed on the player's screen and save it as a png file.
-
.post_update_internal
Execute everything that happens after internal update proceeds.
-
.pre_update_internal
Execute everything that happens before internal update proceeds.
-
.register_viewport(viewport) ⇒ self
Register a viewport to the graphics (for special handling).
-
.resize_screen(width, height)
Resize the window screen.
-
.screen_scale=(scale)
Set the screen scale factor.
-
.shader ⇒ Shader
Get the shader of the graphics.
-
.shader=(shader)
Set the shader of the graphics.
-
.snap_to_bitmap ⇒ LiteRGSS::Bitmap
Snap the graphics to bitmap.
-
.sort_z
Sort the graphics in z.
-
.start
Start the graphics.
-
.stop
Stop the graphics.
-
.swap_fullscreen
Define swap_fullscreen so the icon is taken in account.
-
.transition(frame_count_or_sec = 8, texture = nil)
Transition the graphics between a scene to another.
-
.unregitser_viewport(viewport) ⇒ self
Unregister a viewport.
-
.update
Update graphics window content & events.
-
.update_no_input
Update the graphics window content.
-
.update_only_input
Update the graphics window event without drawing anything.
-
.wait(frame_count_or_sec) { ... }
Make the graphics wait for an amout of time.
-
.width ⇒ Integer
Get the width of the graphics.
Methods included from FPSAndMouse
#frame_reset, #init_sprite, #post_update_internal, #pre_update_internal, #reset_mouse_viewport, #transition, #update_freeze, #update_transition_internal
Methods included from GraphicsFPSBalancer
Methods included from Touch
#init_sprite, #pre_update_internal
Methods included from TouchViewport
#init_sprite, #post_update_internal
Class Attribute Details
.current_time ⇒ Time (readonly)
Get the current time
669 670 671 |
# File 'docs/0_Dependencies.rb', line 669 def current_time @current_time end |
.frame_count ⇒ Integer
Get the global frame count
663 664 665 |
# File 'docs/0_Dependencies.rb', line 663 def frame_count @frame_count end |
.frame_rate ⇒ Integer
Get the framerate
666 667 668 |
# File 'docs/0_Dependencies.rb', line 666 def frame_rate @frame_rate end |
.fullscreen_toggle_enabled
Tell if it is allowed to go fullscreen with ALT+ENTER
674 675 676 |
# File 'docs/0_Dependencies.rb', line 674 def fullscreen_toggle_enabled @fullscreen_toggle_enabled end |
.last_time ⇒ Time (readonly)
Get the time when the last frame was executed
672 673 674 |
# File 'docs/0_Dependencies.rb', line 672 def last_time @last_time end |
.window ⇒ LiteRGSS::DisplayWindow (readonly)
Get the game window
660 661 662 |
# File 'docs/0_Dependencies.rb', line 660 def window @window end |
Class Method Details
.brightness ⇒ Integer
Get the brightness of the main game window
689 690 |
# File 'docs/0_Dependencies.rb', line 689 def brightness end |
.brightness=(brightness)
Set the brightness of the main game window
693 694 |
# File 'docs/0_Dependencies.rb', line 693 def brightness=(brightness) end |
.delta ⇒ Float
Tell how much time there was since last frame
685 686 |
# File 'docs/0_Dependencies.rb', line 685 def delta end |
.focus? ⇒ Boolean
Tell if the graphics window has focus
677 678 |
# File 'docs/0_Dependencies.rb', line 677 def focus? end |
.frame_reset
Reset frame counter (for FPS reason)
774 775 |
# File 'docs/0_Dependencies.rb', line 774 def frame_reset end |
.freeze
Freeze the graphics
712 713 |
# File 'docs/0_Dependencies.rb', line 712 def freeze end |
.frozen? ⇒ Boolean
Tell if the graphics are frozen
681 682 |
# File 'docs/0_Dependencies.rb', line 681 def frozen? end |
.height ⇒ Integer
Get the height of the graphics
697 698 |
# File 'docs/0_Dependencies.rb', line 697 def height end |
.init_sprite
Init the Sprite used by the Graphics module
777 778 |
# File 'docs/0_Dependencies.rb', line 777 def init_sprite end |
.load_icon
Load the window icon
883 884 |
# File 'docs/0_Dependencies.rb', line 883 def load_icon end |
.on_start(&block)
Register an event on start of graphics
761 762 |
# File 'docs/0_Dependencies.rb', line 761 def on_start(&block) end |
.original_swap_fullscreen
Swap the fullscreen state
885 886 |
# File 'docs/0_Dependencies.rb', line 885 def swap_fullscreen end |
.player_view_screenshot(filename, scale)
Take a screenshot of what's currently displayed on the player's screen and save it as a png file
726 727 |
# File 'docs/0_Dependencies.rb', line 726 def player_view_screenshot(filename, scale) end |
.post_update_internal
Execute everything that happens after internal update proceeds
746 747 |
# File 'docs/0_Dependencies.rb', line 746 def post_update_internal end |
.pre_update_internal
Execute everything that happens before internal update proceeds
743 744 |
# File 'docs/0_Dependencies.rb', line 743 def pre_update_internal end |
.register_viewport(viewport) ⇒ self
Register a viewport to the graphics (for special handling)
766 767 |
# File 'docs/0_Dependencies.rb', line 766 def () end |
.resize_screen(width, height)
Resize the window screen
717 718 |
# File 'docs/0_Dependencies.rb', line 717 def resize_screen(width, height) end |
.screen_scale=(scale)
Set the screen scale factor
787 788 |
# File 'docs/0_Dependencies.rb', line 787 def screen_scale=(scale) end |
.shader ⇒ Shader
Get the shader of the graphics
705 706 |
# File 'docs/0_Dependencies.rb', line 705 def shader end |
.shader=(shader)
Set the shader of the graphics
709 710 |
# File 'docs/0_Dependencies.rb', line 709 def shader=(shader) end |
.snap_to_bitmap ⇒ LiteRGSS::Bitmap
Snap the graphics to bitmap
721 722 |
# File 'docs/0_Dependencies.rb', line 721 def snap_to_bitmap end |
.sort_z
Sort the graphics in z
780 781 |
# File 'docs/0_Dependencies.rb', line 780 def sort_z end |
.start
Start the graphics
729 730 |
# File 'docs/0_Dependencies.rb', line 729 def start end |
.stop
Stop the graphics
732 733 |
# File 'docs/0_Dependencies.rb', line 732 def stop end |
.swap_fullscreen
Define swap_fullscreen so the icon is taken in account
783 784 |
# File 'docs/0_Dependencies.rb', line 783 def swap_fullscreen end |
.transition(frame_count_or_sec = 8, texture = nil)
Transition the graphics between a scene to another
737 738 |
# File 'docs/0_Dependencies.rb', line 737 def transition(frame_count_or_sec = 8, texture = nil) end |
.unregitser_viewport(viewport) ⇒ self
Unregister a viewport
771 772 |
# File 'docs/0_Dependencies.rb', line 771 def () end |
.update
Update graphics window content & events. This method might wait for vsync before updating events
740 741 |
# File 'docs/0_Dependencies.rb', line 740 def update end |
.update_no_input
Update the graphics window content. This method might wait for vsync before returning
749 750 |
# File 'docs/0_Dependencies.rb', line 749 def update_no_input end |
.update_only_input
Update the graphics window event without drawing anything.
752 753 |
# File 'docs/0_Dependencies.rb', line 752 def update_only_input end |
.wait(frame_count_or_sec) { ... }
Make the graphics wait for an amout of time
757 758 |
# File 'docs/0_Dependencies.rb', line 757 def wait(frame_count_or_sec) end |
.width ⇒ Integer
Get the width of the graphics
701 702 |
# File 'docs/0_Dependencies.rb', line 701 def width end |