B4J Question [WebApp] Animating Shapes

Bachrock

Member
Licensed User
Longtime User
I have some simple shapes on my website that I just created using the new websockets. I want to create a ROTATE animation on a rectangle. I would like to specify the degree and also I would like to offset the point of origin for the rotation. Ultimately I would like the angle of rotation to be based on a dynamic value.
 

Bachrock

Member
Licensed User
Longtime User
Erel, attached is the Html code and the jrotate.js file that I found on the web to animate images and shapes. I have it working fine however it only works on the client side. I am serving this up using the HelloWorldWebApp websockets you recently provided. Again it works good other than I want to animate #square1 from the server side not the client side. So that when the object rotates all viewing the website will see it. I was wondering if the janimate library or JavaObject library would work for this. Also one key beyond simple rotation is I need to offset the rotation point as I have done in this html code. Thanks
 

Attachments

  • index.zip
    6.1 KB · Views: 232
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Do you see any animation when you open index.html in a browser?

So that when the object rotates all viewing the website will see it.
You should remember that each connected client sees a different instance of the website. They are not sharing the same content (unless you explicitly implement it).

Example of server animation: http://basic4ppc.com:51042/smiley/ (part of the online server examples).

Though in most cases it is better to implement animations in the client. Not the server.

I was wondering if the janimate library or JavaObject library would work for this.
No. The animation is not really related to any Java API. Only JavaScript.
 
Upvote 0

Bachrock

Member
Licensed User
Longtime User
Erel was the question "Do you see any animation when you open index.html in a browser? for me? Yes I have animation working when I click on a button I can get the square to rotate. Works quite nicely. Again I need to do it at the server so that all see the animation. I will study the smiley example and see if this gives me any ideas. I was hoping one of the libraries would help but apparently not. I have some other options too I will investigate. Thanks for the help..
 
Upvote 0

Bachrock

Member
Licensed User
Longtime User
Ok thanks for the help. Yeah I am pretty new to all this so I apologize if my questions are not inline with reality. I do appreciate your help though.
 
Upvote 0
Top