Class: Sprite_Picture

Inherits:
ShaderedSprite show all
Defined in:
docs/01450_Systems_00003_Map_Engine.rb

Overview

A sprite that show a Game_Picture on the screen

Constant Summary collapse

SPRITE_SHADER =

Shader of a Sprite Picture to allow color & tone processing over them

"  uniform vec4 tone;\n  const vec3 lumaF = vec3(.299, .587, .114);\n  uniform sampler2D texture;\n  void main()\n  {\n    vec4 frag = texture2D(texture, gl_TexCoord[0].xy);\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;\n  }\n"

Instance Attribute Summary collapse

Attributes inherited from LiteRGSS::ShaderedSprite

#blendmode, #shader

Attributes inherited from LiteRGSS::Sprite

#__index__, #angle, #bitmap, #height, #mirror, #opacity, #ox, #oy, #src_rect, #viewport, #visible, #width, #x, #y, #z, #zoom, #zoom_x, #zoom_y

Instance Method Summary collapse

Methods inherited from Sprite

#load, #mouse_in?, #set_origin_div, #set_rect, #set_rect_div, #set_z, #simple_mouse_in?, #translate_mouse_coords

Methods inherited from LiteRGSS::Sprite

new, #set_origin, #set_position

Methods inherited from LiteRGSS::Disposable

#disposed?

Constructor Details

#initialize(viewport, picture) ⇒ Sprite_Picture

Initialize a new Sprite_Picture

Parameters:

  • viewport (Viewport)

    the viewport where the sprite will be shown

  • picture (Game_Picture)

    the picture



282
283
# File 'docs/01450_Systems_00003_Map_Engine.rb', line 282

def initialize(viewport, picture)
end

Instance Attribute Details

#gif_loop_disabledBoolean

Tell if the loop of the gif is disabled or not

Returns:

  • (Boolean)


276
277
278
# File 'docs/01450_Systems_00003_Map_Engine.rb', line 276

def gif_loop_disabled
  @gif_loop_disabled
end

Instance Method Details

#dispose

Dispose the picture



285
286
# File 'docs/01450_Systems_00003_Map_Engine.rb', line 285

def dispose
end

#gif_done?Boolean

Tell if the gif animation is done

Returns:

  • (Boolean)


292
293
# File 'docs/01450_Systems_00003_Map_Engine.rb', line 292

def gif_done?
end

#update

Update the picture sprite display with the information of the current Game_Picture



288
289
# File 'docs/01450_Systems_00003_Map_Engine.rb', line 288

def update
end