Android Question What's the most up to date method for creating a rotating needle type effect

jimseng

Active Member
Licensed User
Longtime User
Hello.
I want to create a speedometer type animation and the examples I have looked at seem from many years ago. The animation is very straightforward but it looks like you can't keep the orientation of the image once it has finished rotating. Is it still the rotating needle example or is there something else I should look at?
Thanks
 

klaus

Expert
Licensed User
Longtime User
In the xGauges b4xlib i use the Rotation property of a Panel or Pane as a B4XView.
I use a Panel / Pane and a B4XCnavas to draw the needle.
You could do the rotation with any B4XView like an ImageView.
I think that this is currently the easiest way to do it.
You can unzip the library xGauges.b4xlib file to get the code.
 
Last edited:
Upvote 0

emexes

Expert
Licensed User
I want to create a speedometer type animation and the examples I have looked at seem from many years ago ... it looks like you can't keep the orientation of the image once it has finished rotating.

Lol, you're not talking about this example, are you? :

The performance of .Rotation can be surprisingly good too:



which was less than straightforward :oops: : we were testing out @Scantech's idea of mounting the phone on a car steering wheel but keeping the gauges level even whilst the steering wheel was turning.

It uses @klaus's .Rotation technique (to give credit where it's due - prior to that, we'd been rotating bitmaps "manually")
 
Upvote 0
Top