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

How to enable download in webview in Sketchware apps?

TextInputLayout in Sketchware

Create Stopwatch App in Android using Sketchware

How to integrate Admob Ads in Sketchware project using AIDE?

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

Code for implementing Notifications in Sketchware

A Flash Light App in Sketchware

Create a Stopwatch App using Chronometer in Sketchware

Create app to save all passwords, protected using voice key