Class cocos.actions.grid3d_actions.Ripple3D

             object --+                
                      |                
    base_actions.Action --+            
                          |            
base_actions.IntervalAction --+        
                              |        
basegrid_actions.GridBaseAction --+    
                                  |    
      basegrid_actions.Grid3DAction --+
                                      |
                                     Ripple3D

Simulates a ripple (radial wave) effect. The amplitude of the wave will decrease when it goes away from the center of the ripple. It modifies the z-coordinate while the x and y remains unmodified.

Example:

scene.do( Ripple3D(center=(320,240), radius=240, waves=15, amplitude=60, duration=20, grid=(32,24) ) )

Methods

  init(self, center=(-1,-1), radius=240, waves=15, amplitude=60, *args, **kw)
Initialize the Grid Action
  update(self, t)
Gets called on every frame.
Inherited from basegrid_actions.Grid3DAction: get_grid, get_original_vertex, get_vertex, set_vertex Inherited from basegrid_actions.GridBaseAction: __reversed__, start Inherited from base_actions.IntervalAction: done Inherited from base_actions.Action: __add__, __init__, __mul__, __or__, step, stop Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Properties

Inherited from object: __class__

Instance Variables

  position
Center of the ripple.
  radius
radius of the ripple.
  waves
number of waves.
  amplitude_rate
amplitude rate.
Inherited from base_actions.Action: target

Method Details

init

init(self, center=(-1,-1), radius=240, waves=15, amplitude=60, *args, **kw)
Initialize the Grid Action
Parameters:
center : (int,int)
Center of the ripple. Default: (win_size_width /2, win_size_height /2 )
radius : int
Radius of the ripple. Default: 240
waves : int
Number of waves (2 * pi) that the action will perform. Default: 15
amplitude : int
Wave amplitude (height). Default is 60
Overrides:
basegrid_actions.GridBaseAction.init

update

update(self, t)
Gets called on every frame. t is in [0,1] If this action takes 5 seconds to execute, t will be equal to 0 at 0 seconds. t will be 0.5 at 2.5 seconds and t will be 1 at 5sec.
Overrides:
base_actions.IntervalAction.update

Instance Variable Details

position

Center of the ripple. Type: (int,int). This value can be modified by other actions, like JumpBy to simulate a jumping ripple effect

radius

radius of the ripple. Type: float

waves

number of waves. Type: int

amplitude_rate

amplitude rate. Default: 1.0. This value is modified by other actions like AccelAmplitude.