Changeset 1344
- Timestamp:
- 03/24/08 08:42:28 (3 months ago)
- Files:
-
- mochikit/trunk/doc/html/MochiKit/Visual.html (modified) (2 diffs)
- mochikit/trunk/doc/rst/MochiKit/Visual.rst (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
mochikit/trunk/doc/html/MochiKit/Visual.html
r1343 r1344 55 55 effects are ported from <a class="reference" href="http://script.aculo.us">Scriptaculous</a>.</p> 56 56 <div class="section"> 57 <h2><a id="animations-effects" name="animations-effects">Animations & Effects</a></h2> 58 <p>Dynamic or animated effects are managed by a basic looping service (see 59 <a class="mochiref reference" href="#fn-base">Base</a>). The effect looping is controlled by timers that are invoked 60 at regular and short intervals while the effect is executing. The base looping 61 service takes the current system time into consideration, automatically 62 skipping effect steps on execution delays.</p> 63 <p>The effect classes need only handle dynamic updates based on a floating-point 64 number between <tt class="docutils literal"><span class="pre">0.0</span></tt> and <tt class="docutils literal"><span class="pre">1.0</span></tt> (the effect position). This effect position 65 may also be manipulated by <a class="mochiref reference" href="#fn-transitions">Transitions</a> to provide non-linear 66 updates, which may further enhance the visual effect.</p> 67 <p>The effect timer and transitions can be controlled through a set of 68 <a class="mochiref reference" href="#fn-defaultoptions">DefaultOptions</a> that are available for all effect classes.</p> 69 </div> 70 <div class="section"> 57 71 <h2><a id="the-effects-queue" name="the-effects-queue">The Effects Queue</a></h2> 58 72 <p>When you create effects based on user input (mouse clicks for example), it can … … 60 74 same time. To manage this problem, the Queue mechanism has been introduced: 61 75 it's responsible for running the effects as you desired.</p> 62 <p>By default, you have one Queue called 'global', and the effects run in 'parallel' 63 (see default options). Every effects have a queue option to customize this. 64 It can be a string, the scope is then global:</p> 76 <p>By default, you have one Queue called <tt class="docutils literal"><span class="pre">'global'</span></tt>, and the effects run in 77 <tt class="docutils literal"><span class="pre">'parallel'</span></tt> (see <a class="mochiref reference" href="#fn-defaultoptions">DefaultOptions</a>). Every effect has a <tt class="docutils literal"><span class="pre">queue</span></tt> 78 option to customize this. It's value can be a string, thereby using the 79 <tt class="docutils literal"><span class="pre">global</span></tt> scope:</p> 65 80 <ul class="simple"> 66 <li><cite> start</cite>: the effect will be run before any other;</li>67 <li><cite>end</cite>: the effect will be run after any other;</li>68 <li><cite>break</cite>: every other effect s breakwhen the the effect start;</li>69 <li><cite>parallel</cite>: the effect run normally with others.</li>81 <li><cite>front</cite>: the effect will be run before any other non-started effect;</li> 82 <li><cite>end</cite>: the effect will be run when all other effects have finished;</li> 83 <li><cite>break</cite>: every other effect is immediately finalized when the the effect start;</li> 84 <li><cite>parallel</cite>: the effect runs in parallel with other effects.</li> 70 85 </ul> 71 <p>But you have even more control if you use an array with the following keys:</p> 86 <p>But you have even more control if you use an object with the following 87 property keys:</p> 72 88 <ul class="simple"> 73 <li><cite>position</cite> takes a value listed above;</li> 74 <li><cite>scope</cite> manages how the information has to be taken. If it's <cite>global</cite> 75 then it's the same information for every effects. Otherwise you can define 76 your own scode. For example, if you add an effect on a specified element, 77 you may use the element id as scode;</li> 78 <li><cite>limit</cite> defines how many effects can run in the current scode. If an 79 effect is added whereas the limit is reached, it will never be run (it's 80 lost).</li> 89 <li><cite>position</cite> takes one of the values listed above;</li> 90 <li><cite>scope</cite> contains the queue name. If it's <tt class="docutils literal"><span class="pre">"global"</span></tt> the effect will use the 91 default queue, otherwise you can define your own queue name. For example, if 92 you add an effect on a specified element, you may use the element id as scope;</li> 93 <li><cite>limit</cite> defines how many effects can be stored in the queue at a single time. 94 If an effect is added when the limit has been reached, it will never be run 95 (it's lost).</li> 81 96 </ul> 82 97 </div> mochikit/trunk/doc/rst/MochiKit/Visual.rst
r1343 r1344 52 52 53 53 54 Animations & Effects 55 -------------------- 56 57 Dynamic or animated effects are managed by a basic looping service (see 58 :mochiref:`Base`). The effect looping is controlled by timers that are invoked 59 at regular and short intervals while the effect is executing. The base looping 60 service takes the current system time into consideration, automatically 61 skipping effect steps on execution delays. 62 63 The effect classes need only handle dynamic updates based on a floating-point 64 number between ``0.0`` and ``1.0`` (the effect position). This effect position 65 may also be manipulated by :mochiref:`Transitions` to provide non-linear 66 updates, which may further enhance the visual effect. 67 68 The effect timer and transitions can be controlled through a set of 69 :mochiref:`DefaultOptions` that are available for all effect classes. 70 71 54 72 The Effects Queue 55 73 ----------------- … … 60 78 it's responsible for running the effects as you desired. 61 79 62 By default, you have one Queue called 'global', and the effects run in 'parallel' 63 (see default options). Every effects have a queue option to customize this. 64 It can be a string, the scope is then global: 65 66 - `start`: the effect will be run before any other; 67 - `end`: the effect will be run after any other; 68 - `break`: every other effects break when the the effect start; 69 - `parallel`: the effect run normally with others. 70 71 But you have even more control if you use an array with the following keys: 72 73 - `position` takes a value listed above; 74 - `scope` manages how the information has to be taken. If it's `global` 75 then it's the same information for every effects. Otherwise you can define 76 your own scode. For example, if you add an effect on a specified element, 77 you may use the element id as scode; 78 - `limit` defines how many effects can run in the current scode. If an 79 effect is added whereas the limit is reached, it will never be run (it's 80 lost). 80 By default, you have one Queue called ``'global'``, and the effects run in 81 ``'parallel'`` (see :mochiref:`DefaultOptions`). Every effect has a ``queue`` 82 option to customize this. It's value can be a string, thereby using the 83 ``global`` scope: 84 85 - `front`: the effect will be run before any other non-started effect; 86 - `end`: the effect will be run when all other effects have finished; 87 - `break`: every other effect is immediately finalized when the the effect start; 88 - `parallel`: the effect runs in parallel with other effects. 89 90 But you have even more control if you use an object with the following 91 property keys: 92 93 - `position` takes one of the values listed above; 94 - `scope` contains the queue name. If it's ``"global"`` the effect will use the 95 default queue, otherwise you can define your own queue name. For example, if 96 you add an effect on a specified element, you may use the element id as scope; 97 - `limit` defines how many effects can be stored in the queue at a single time. 98 If an effect is added when the limit has been reached, it will never be run 99 (it's lost). 81 100 82 101
