How to set an object into pendulum motion in Sketchware?

How to create a pendulum in Sketchware?
Here is a video of how I created a pendulum in Sketchware:


Firstly​, in View field create a pendulum in a linear horizontal block, either using an imageview or textview. It should be such that the pendulum lies horizontally in right half of the linear horizontal block.


Next, create a new timer, and a new function.

Add a new variable t and set it's​ value to 0 in onCreate event. Also set rotation of textview to 90°.

Now define the new function in such a way that the linear horizontal rotates in pendulum motion repeatedly. Use the codes as shown in the image below.

And then save and run the project. It will show your image or text in pendulum motion.

Komentar

Cara pembuatan Apps paling Populer

Create Stopwatch App in Android using Sketchware

TextInputLayout in Sketchware

How to find and​ highlight a word in a text field in Sketchware?

A Flash Light App in Sketchware

How to enable download in webview in Sketchware apps?

Intent - Open File By Type

Code for implementing Notifications in Sketchware

How to share an image from Drawable folder?

ActionBar back button

Animation Transtition Animation