Class: Plane
- Inherits:
-
Sprite
- Object
- LiteRGSS::Disposable
- LiteRGSS::Drawable
- LiteRGSS::Sprite
- LiteRGSS::ShaderedSprite
- Sprite
- Plane
- Defined in:
- docs/00000_Dependencies.rb
Overview
Class simulating repeating texture
Constant Summary collapse
- SHADER =
Shader of the Plane sprite
"// Viewport tone (required)\nuniform vec4 tone;\n// Viewport color (required)\nuniform vec4 color;\n// Zoom configuration\nuniform vec2 zoom;\n// Origin configuration\nuniform vec2 origin;\n// Texture size configuration\nuniform vec2 textureSize;\n// Texture source\nuniform sampler2D texture;\n// Plane Texture (what's zoomed origined etc...)\nuniform sampler2D planeTexture;\n// Screen size\nuniform vec2 screenSize;\n// Gray scale transformation vector\nconst vec3 lumaF = vec3(.299, .587, .114);\n// Main process\nvoid main()\n{\n // Coordinate on the screen in pixel\n vec2 screenCoord = gl_TexCoord[0].xy * screenSize;\n // Coordinaet in the texture in pixel (including zoom)\n vec2 bmpCoord = mod(origin + screenCoord / zoom, textureSize) / textureSize;\n vec4 frag = texture2D(planeTexture, bmpCoord);\n // Tone&Color process\n frag.rgb = mix(frag.rgb, color.rgb, color.a);\n float luma = dot(frag.rgb, lumaF);\n frag.rgb += tone.rgb;\n frag.rgb = mix(frag.rgb, vec3(luma), tone.w);\n frag.a *= gl_Color.a;\n // Result\n gl_FragColor = frag * texture2D(texture, gl_TexCoord[0].xy);\n}\n"
Instance Attribute Summary collapse
-
#blend_type ⇒ Integer
Return the blend type.
-
#color ⇒ Color
Return the color of the plane /!\ this is unlinked set() won’t change the color.
-
#texture ⇒ Texture
Get the real texture.
-
#tone ⇒ Tone
Return the tone of the plane /!\ this is unlinked set() won’t change the color.
-
#visible ⇒ Boolean
Return the visibility of the plane.
Attributes inherited from LiteRGSS::ShaderedSprite
Attributes inherited from LiteRGSS::Sprite
#__index__, #angle, #height, #mirror, #opacity, #src_rect, #viewport, #width, #x, #y, #z, #zoom
Class Method Summary collapse
-
.texture ⇒ Texture
Get the generic plane texture.
Instance Method Summary collapse
-
#bitmap ⇒ Texture
(also: #working_texture)
Get the real texture.
-
#initialize(viewport) ⇒ Plane
constructor
Create a new plane.
-
#ox ⇒ Float
Get the ox of the Plane.
-
#ox=(origin)
Set the ox of the Plane.
-
#oy ⇒ Float
Get the oy of the Plane.
-
#oy=(origin)
Set the oy of the Plane.
-
#set_origin(ox, oy)
Set the origin of the Plane.
-
#zoom=(zoom)
Set the zoom of the Plane.
-
#zoom_x ⇒ Float
Get the zoom_x of the Plane.
-
#zoom_x=(zoom)
Set the zoom_x of the Plane.
-
#zoom_y ⇒ Float
Get the zoom_y of the Plane.
-
#zoom_y=(zoom)
Set the zoom_y of the Plane.
Methods inherited from Sprite
#load, #mouse_in?, #set_origin_div, #set_rect, #set_rect_div, #set_z, #simple_mouse_in?, #translate_mouse_coords, #update
Methods inherited from LiteRGSS::Sprite
Methods inherited from LiteRGSS::Disposable
Constructor Details
#initialize(viewport) ⇒ Plane
Create a new plane
784 785 |
# File 'docs/00000_Dependencies.rb', line 784 def initialize() end |
Instance Attribute Details
#blend_type ⇒ Integer
Return the blend type
781 782 783 |
# File 'docs/00000_Dependencies.rb', line 781 def blend_type @blend_type end |
#color ⇒ Color
Return the color of the plane /!\ this is unlinked set() won’t change the color
775 776 777 |
# File 'docs/00000_Dependencies.rb', line 775 def color @color end |
#texture ⇒ Texture
Get the real texture
769 770 771 |
# File 'docs/00000_Dependencies.rb', line 769 def texture @texture end |
#tone ⇒ Tone
Return the tone of the plane /!\ this is unlinked set() won’t change the color
778 779 780 |
# File 'docs/00000_Dependencies.rb', line 778 def tone @tone end |
#visible ⇒ Boolean
Return the visibility of the plane
772 773 774 |
# File 'docs/00000_Dependencies.rb', line 772 def visible @visible end |
Class Method Details
.texture ⇒ Texture
Get the generic plane texture
854 855 |
# File 'docs/00000_Dependencies.rb', line 854 def texture end |
Instance Method Details
#bitmap ⇒ Texture Also known as: working_texture
Get the real texture
793 794 795 |
# File 'docs/00000_Dependencies.rb', line 793 def texture @texture end |
#ox ⇒ Float
Get the ox of the Plane
829 830 |
# File 'docs/00000_Dependencies.rb', line 829 def ox end |
#ox=(origin)
Set the ox of the Plane
825 826 |
# File 'docs/00000_Dependencies.rb', line 825 def ox=(origin) end |
#oy ⇒ Float
Get the oy of the Plane
837 838 |
# File 'docs/00000_Dependencies.rb', line 837 def oy end |
#oy=(origin)
Set the oy of the Plane
833 834 |
# File 'docs/00000_Dependencies.rb', line 833 def oy=(origin) end |
#set_origin(ox, oy)
Set the origin of the Plane
821 822 |
# File 'docs/00000_Dependencies.rb', line 821 def set_origin(ox, oy) end |
#zoom=(zoom)
Set the zoom of the Plane
800 801 |
# File 'docs/00000_Dependencies.rb', line 800 def zoom=(zoom) end |
#zoom_x ⇒ Float
Get the zoom_x of the Plane
808 809 |
# File 'docs/00000_Dependencies.rb', line 808 def zoom_x end |
#zoom_x=(zoom)
Set the zoom_x of the Plane
804 805 |
# File 'docs/00000_Dependencies.rb', line 804 def zoom_x=(zoom) end |
#zoom_y ⇒ Float
Get the zoom_y of the Plane
816 817 |
# File 'docs/00000_Dependencies.rb', line 816 def zoom_y end |
#zoom_y=(zoom)
Set the zoom_y of the Plane
812 813 |
# File 'docs/00000_Dependencies.rb', line 812 def zoom_y=(zoom) end |