/[libvob]/libvob/doc/pegboard/animation_api--mudyc/peg.rst
ViewVC logotype

Diff of /libvob/doc/pegboard/animation_api--mudyc/peg.rst

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.14 by mudyc, Fri Oct 24 11:49:29 2003 UTC revision 1.15 by mudyc, Sat Oct 25 14:15:00 2003 UTC
# Line 77  ISSUE: Should the default be to animate Line 77  ISSUE: Should the default be to animate
77      'animation with time', '"animation" with very short time' or 'reuse      'animation with time', '"animation" with very short time' or 'reuse
78      VobScene'.      VobScene'.
79    
80    
81  ISSUE: What package should this interface be in?  ISSUE: What package should this interface be in?
82  libvob.view doesn't feel right - this isn't a view. How about  libvob.view doesn't feel right - this isn't a view. How about
83  libvob proper?  libvob proper?
# Line 91  Introduction Line 92  Introduction
92    
93  We heavily use the ``demo framework`` in our applications, see  We heavily use the ``demo framework`` in our applications, see
94  vob.putil.demo. ``Demo framework`` basicly is libvob using one window;  vob.putil.demo. ``Demo framework`` basicly is libvob using one window;
95  including dynamic realoading of jython source and switching between demo scenes.  including dynamic realoading of jython source and switching
96  One window is obivious to get more testing with irregular edge.  between demo scenes. One window is obivious to get more
97    testing with irregular edge.
98    
99  The animation seen in the window is made with one or two VobScenes.  The animation seen in the window is made with one or two VobScenes.
100  Although, VobScene is very close to *one* window we have no interfaces  Although, VobScene is very close to *one* window we have no interfaces
# Line 166  Let's define the following interface: :: Line 168  Let's define the following interface: ::
168          /** Animate to next VobScene by creating a new VobScene.          /** Animate to next VobScene by creating a new VobScene.
169           * The interpolation time between current screen and VobScene           * The interpolation time between current screen and VobScene
170           * (screen after animations) in future is set via AbstractUpdateManager.           * (screen after animations) in future is set via AbstractUpdateManager.
171             * This method is pending, i.e., next screen update is soon
172             * but not immediately.
173           * <p>           * <p>
174           * Animation between scenes is done between keys, i.e., key "A" in           * Animation between scenes is done between keys, i.e., key "A" in
175           * current visible scene will animate to where           * current visible scene will animate to where
# Line 179  Let's define the following interface: :: Line 183  Let's define the following interface: ::
183           * you could do it, like:           * you could do it, like:
184           * <pre>           * <pre>
185           *      class Scene:           *      class Scene:
186           *          """ Example scene to animate red box from left to rigth and backwards.           *          """ Example scene to animate red box from left to rigth
187             *          and backwards.
188           *          """           *          """
189           *          def __init__(self, animation):           *          def __init__(self, animation):
190           *              self.anim = animation           *              self.anim = animation
# Line 187  Let's define the following interface: :: Line 192  Let's define the following interface: ::
192           *              self.left = 100           *              self.left = 100
193           *              self.right = 500           *              self.right = 500
194           *          def scene(self, vs):           *          def scene(self, vs):
195           *              if self.keyHit == 1:           *              if self.keyHit == 0:
196           *                  cs = vs.orthoBoxCS(0, "RedBox", 0,self.left,50, 1,1, 100,100)           *                  cs = vs.orthoBoxCS(0, "RedBox", 0,self.left,
197             *                      50, 1,1, 100,100)
198           *              else:           *              else:
199           *                  cs = vs.orthoBoxCS(0, "RedBox", 0,self.right,50, 1,1, 100,100)           *                  cs = vs.orthoBoxCS(0, "RedBox", 0,self.right,
200             *                      50, 1,1, 100,100)
201           *              vs.put(vob.vobs.RectBgVob(java.awt.Color.red), cs)           *              vs.put(vob.vobs.RectBgVob(java.awt.Color.red), cs)
202           *          def key(self, key):           *          def key(self, key):
203           *              self.keyHit = 1 - self.keyHit           *              self.keyHit = 1 - self.keyHit
# Line 201  Let's define the following interface: :: Line 208  Let's define the following interface: ::
208    
209    
210          /** Switch to next VobScene by creating a new VobScene.          /** Switch to next VobScene by creating a new VobScene.
211           * The switch is fast and no animation is seen.           * The switch is fast and no animation is seen.
212             * This method is pending, i.e., next screen update is soon
213             * but not immediately.
214           */           */
215          void switchVS();          void switchVS();
216    
217    
218          /** Rerender the current VobScene.          /** Rerender the current VobScene.
219             * This method is pending, i.e., next screen update is soon
220             * but not immediately.
221             * <p>
222           * Changes in next frame are seen if coordinate system           * Changes in next frame are seen if coordinate system
223           * parameters are set. Rerendering the current VobScene           * parameters are set. Rerendering the current VobScene
224           * is much faster than creating a new VobScene,           * is much faster than creating a new VobScene,
# Line 234  Let's define the following interface: :: Line 246  Let's define the following interface: ::
246    
247    
248          /** Returns true if VobScene has changed since previous          /** Returns true if VobScene has changed since previous
249           * <code>animate</code> or <code>switchVS</code> method.           * <code>animate</code> or <code>switchVS</code> method,
250             * i.e., screen has updated.
251           * <p>           * <p>
252           * Programming note:           * Programming note:
253           * In some situations when handling the events the programmer           * In some situations when handling the events the programmer
254           * needs to know whether the VobScene is new or the still the old one,           * needs to know whether the VobScene is new or the still the old one,
255           * e.g., when waiting the screen to update to move some new vob you           * e.g., when waiting the screen to update to move some new vob you

Legend:
Removed from v.1.14  
changed lines
  Added in v.1.15

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26