Rotating widgets

Tore Nilsen tore.nilsen at me.com
Sat Oct 14 14:30:20 EDT 2017


You would probably be better off using a transparent png-image that is square for the clock hand, and where the rotation point of the clock hand was at the center of the square. You could then put the clock hand on top of the clock face and rotate the hand at will. My students hand the same kind of problem as part of their national exam this spring. You could also do some vector calculations to find the new center for your widget, but I must admit that I am not all that certain how you would go about it then. Mathematics is not my strongest subject, and I must admit that at 56 I have forgotten most of the maths I learnt in my upper secondary years.


Regards
Tore


> 14. okt. 2017 kl. 20:14 skrev Richmond Mathewson via use-livecode <use-livecode at lists.runrev.com>:
> 
> I am getting a bit fudgey with clock hands.
> 
> I have used my SVG importer stack to import a minute and an hour hand as SVG widgets, as well as
> a clock face.
> 
> The "only snag" is that when I do this sort of thing:
> 
> set the angle of widget "hourHand" to 90
> 
> it rotates the widget round its centre rather than round the bit that a clock hand would naturally rotate around.
> 
> So . . .
> 
> is there a way to do something like this:
> 
> [pseudo-code]
> 
> set the angle of widget "hourHand" to 90 at point 20,200
> 
> ?
> 
> where "point 20,200" refers to a position on the widget around which rotation can take place.
> 
> Richmond.
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode





More information about the use-livecode mailing list