I create this post again and again and ask for a concrete example of how to create a square to replace a second hand.
If you already advise me, you will refer me to a specific example...
I create this post again and again and ask for a concrete example of how to create a square to replace a second hand.
If you already advise me, you will refer me to a specific example...
hi,
an Answer has already been given to you:
Look at the code in the Analog sample app, specifically generateHandCoordinates in AnalogView.mc.
so look at the Sample in the SDK, you will find all you need.
So I did, but how can I keep the seconds at the edge of the screen, not from the center?
function renderSeconds(dc) { var clockTime = Sys.getClockTime(); var clock_sec = clockTime.sec; var sec = ( clock_sec / 60.0) * Math.PI * 2; dc.setColor(Gfx.COLOR_RED, Gfx.COLOR_TRANSPARENT); renderSecondss(dc, sec, 200, 10, 20); } function renderSecondss(dc, angle, length, width, overheadLength) { var hand = [ [-(width/2), 0 + overheadLength], [-(width/2), -length], [width/2, -length], [width/2, 0 + overheadLength] ]; var result = new [4]; var cos = Math.cos(angle); var sin = Math.sin(angle); for (var i = 0; i < 4; i += 1) { var x = (hand[i][0] * cos) - (hand[i][1] * sin); var y = (hand[i][0] * sin) + (hand[i][1] * cos); result[i] = [ centerX + x, centerY + y]; } dc.fillPolygon(result); }
The values of centerX and centerY are used to translate the polygon to a new origin. If you want to move the polygon, change those values.
result[i] = [ centerX + x, centerY + y];
I create this post again and again
Stop creating new posts then, and keep asking the question in your original thread. There are like 5 threads on this topic...
If you are the admin of this forum, you should rather restore the links to the instructions and not teach who many times establishes a repeated post. I asked for help several times and I only got it from the user Bodya. So think about it ...
I asked for help several times and I only got it from the user Bodya. So think about it ...
Yes, Bodya did help you by providing code showing how to draw a rounded rectangle.
As far as I can tell, of the three remaining posts about rotating a square, only myself and Shent-Aurkhan (SHN) responded. I responded in a timely manner, provided references to source code, and answered follow-up questions.
you should rather restore the links to the instructions
Perhaps you could show what links you want restored?
and not teach who many times establishes a repeated post
You complained that you had to create the same post again and again. Creating all of those threads just wastes the time of people like me who are here to help.