Jump to content
Search Community

dominate

Members
  • Posts

    13
  • Joined

  • Last visited

Everything posted by dominate

  1. I had thought that I'll also need a loop which will execute the messages when available, and suspend until the message is available. But I think that checking & executing from the list every time a new message comes will be enough. Thanks.
  2. So do you think that using TimeLine wouldn't make sense?
  3. Thank you for response. And how about the messages that do not exist yet? Because they are coming asynchronously. Let say {message: "", order: 3} did not come yet, but {order: 2} and {order: 4} already exist. Then Timeline should execute {order: 2} but should wait {order: 3}, and until {order: 3} is available, not execute any thing. Once {order: 3} comes, then continue execute: {order: 3}, {order: 4}, ... I imagine that it could do that by writing onComplete, onStart etc callbacks, right? What I do not calculate well is if using Timeline for this aim is more suitable then writing my own mechanism from scratch.
  4. I am designing a simple multiplayer game (html5). I have noticed that although the server send the messages in an order, rarely the clients may receive them in another order. (I know that it is possible to implement ACK for every message receiving, but I do not prefer.) I have used deferred objects to wait an action to be finished before executing the new one, but this way shortly complicated the code and it became non-trivial to follow the order. So, I needed a "Manager" to organize this. At this point, I thought if I could use Timeline to do that. What I want is, although the client receives the messages in wrong order, execute it in javascript in the right order. This requires to hold a structure, like message-queue. Hold non-executed messages in a queue, in a order that is told by server. (ie: msg1: {order: 1}, msg2: {order:2 }, ... although msg2 is received before msg1, since currentOrder < msg2.order, it would wait to be executed) Then, execute the messages from the front of the queue and once it is executed, delete from the queue. Could I use Timeline for such job? Do you think it is appropriate for that?
  5. In my case timing is not too restricted, because of that the server is rather relaxed. I appreciate your suggestion. Thank you.
  6. But occurs some thing like this: - Server sends an information to x clients. - Then clients will see a tween of 10 seconds. - At the end of tween each client will send ACK to server. - When server gets x ACK, then advances to next step. - But meanwhile, when one client goes to other tab and returns, waiting for tween to be finished causes an unnecessary delay. Of course, the role of server could be increased, but this way decreases the load of the server. The server does not need every time synchronize the clients, except fundamental checkpoints. In other words, the server assures that all clients are in the same state but does not bother how they view.
  7. Yes, I see. I had thought that it was very common feature (Especially in real-time apps it is a must, isn't it?), because of that I was surprised. Thank you.
  8. Zero-duration tween! This is great! Thank you. Between, why startAt is not at https://greensock.com/docs/#/HTML5/GSAP/TweenLite/ ?
  9. I have a graphic object, let say a box, which is drawn on a html5 canvas, let say its position is (x: 50, y:50). It is inside another container, whose position is (x:250, y:250). So, global position of the box is (x:300, y:300). Now, I want to move this box to global (x:100, y:100), and at the beginning I want to move the box from its container, to the global world. So, I try to use onStart, when creating my tween with TweenLite.to. To keep its global position, I set the position of the box in its new parent: onStart: { box.setParent(stage); box.position.set(300, 300); } As a result, the parent is set. But, position does not change. Conclusion: In onStart, I am too late, the box properties was already "somehow" cached by the tween, and that I am changing it does not affect! Question: Is there a way to update properties of the object after/within creating it and just before it starts? Note: lazy: true did not work. Note: setting the parent of the box before creating tween is not a choice. Example: http://codepen.io/anon/pen/GoOWBy Thank you.
  10. Sure, I also did not mean in an offensive way. What I meant with "nice" is: Those workaround solutions have their -expensive- price, ie, losing RAF and/or lagSmoothing. And what about detecting focus on/off? Well, that is the way that one would do also without GS. If in GS such feature was added, it would be optimized I guess, somehow better than the workarounds. I just wanted to know if this happened, since the answers that I found was rather old (about version 1.12.x). Maybe in later versions we'll have that chance. Thanks.
  11. When the browser tab is switched, tween also pauses, and yes, this is a feature. But also the opposite is also very common need! - Switched to other tab - Returned to our tab after some time. - Tweens (or some tweens) are updated as if the tab was never switched, without losing the advantage of RAF. I have found same questions, like this one: http://greensock.com/forums/topic/9887-tween-paused-when-switch-to-other-tabs/ (And I think much more newbies will ask the same again, since this is also commonly desired feature too!) The proposed solutions were some workarounds, like RAF, lagSmoothing, etc. My question is if as of the version 1.18.x the solution is still those workarounds, or there is finally a nice solution. Thanks.
  12. Thanks for replies. So it is better to use Timeline, since if not it must be necessary to maintain a map of tweens.
  13. What I want to achieve is: - Create a tween on myobj and play, let say x:"+=200" - Some other time another "additive" tween may be created, ie., x:"+=200" more!. - So, as a result myobj should go x:"+=400". - To do that, second tween should wait the first one, and then run when it finishes. Moreover, if more tweens come later, they should wait all the previous ones. - Please note that it is unknown how many tweens would exist. They come dynamically. My question is if it is possible to queue like this using TweenLite, or I need TimelineLite. Thanks.
×
×
  • Create New...