It is currently May 1st, 2024, 11:33 pm

3rd Gig

Get help with creating, editing & fixing problems with skins
User avatar
TweaknFreak
Posts: 217
Joined: July 14th, 2012, 7:26 am

3rd Gig

Post by TweaknFreak »

I'm making an analog clock much like 2nd Gig. The minute hand is working perfectly as expected but the hour hand is messing it all up. Heres the code and the images too :─

Code: Select all

[Rainmeter]
BackgroundMode=1
Author=TweaknFreak
Update=1000
MiddleMouseDownAction=[!Refresh]


[MeasureTime]
Measure=Time


[Hours]
Meter=Rotator
ImageName=hour.png
MeasureName=MeasureTime
X=-314
Y=-230
OffsetX=391
OffsetY=391
H=(SQRT(1223048))
W=(SQRT(1223048))
ImageTint=255,255,255,255
ValueRemainder=216000
ImageRotate=29
StartAngle=6.2832
RotationAngle=6.2832
Antialias=1


[Minutes]
Meter=Rotator
ImageName=minutes.png
MeasureName=MeasureTime
X=212
Y=227
OffsetX=141
OffsetY=141
H=(SQRT(159048))
W=(SQRT(159048))
ImageTint=255,255,255,255
ValueRemainder=3600
RotationAngle=6.2832
StartAngle=1.5708
Antialias=1
Please tell me why this is behaving so strangely.

BTW, I'm also confused on two parameters   ValueRemainder  and  ValueReminder. Dunno what both of them mean, but I saw the latter one for the first time in 2nd gig's code.

Thanx a zilllion times.
You do not have the required permissions to view the files attached to this post.
Be one of the iNEViTABLES - Storm, Earthquake, Lightning, Flood - and the world will bow down to you.

My current desktop
[hsimg]http://i1313.photobucket.com/albums/t559/TweaknFreak/6-22-20149-46-40PM_zps7bcbc1f6.png[/hsimg]
User avatar
Kaelri
Developer
Posts: 1721
Joined: July 25th, 2009, 4:47 am

Re: 3rd Gig

Post by Kaelri »

Some points:

- ValueRemainder, if you'll forgive a simplified explanation, scales the measure value. For an hour hand, you would use ValueRemainder=43200 (60 seconds * 60 minutes * 12 hours).

- ValueReminder is a misspelling of ValueRemainder. It still works for backwards compatibility, but you should use ValueRemainder instead.

- You don't need to use square roots for W and H when your images are perfectly square. Just use the original image dimensions.

- The OffsetX and OffsetY should be exactly half the W and H (200). The X and Y only matter in terms of placing the images in relation to each other, so the larger image (hour) can be at 0,0, and the smaller image (minutes) should be centered within the hour's dimensions (59,59).

- Don't use ImageRotate for the Hour rotator. That seems to have a very different effect from what you need. Instead, either adjust the StartAngle so that the meter starts pointing upward, or - better still - use an image editing program to straighten the image.

- Those ImageTints aren't doing anything at all.
User avatar
MerlinTheRed
Rainmeter Sage
Posts: 889
Joined: September 6th, 2011, 6:34 am

Re: 3rd Gig

Post by MerlinTheRed »

damn. I never would have thought that ImageRotate has anything to do with this. I tried fixing it and was baffled that I had to use offsetx/y=272 so the hour rotates around its center. I guess the ImageRotate changes the effective size of the image before the offset is applied.
Have more fun creating skins with Sublime Text 2 and the Rainmeter Package!
User avatar
TweaknFreak
Posts: 217
Joined: July 14th, 2012, 7:26 am

Re: 3rd Gig

Post by TweaknFreak »

Kaelri wrote:Some points:

- ValueRemainder, if you'll forgive a simplified explanation, scales the measure value. For an hour hand, you would use ValueRemainder=43200 (60 seconds * 60 minutes * 12 hours).

- ValueReminder is a misspelling of ValueRemainder. It still works for backwards compatibility, but you should use ValueRemainder instead.

- You don't need to use square roots for W and H when your images are perfectly square. Just use the original image dimensions.

- The OffsetX and OffsetY should be exactly half the W and H (200). The X and Y only matter in terms of placing the images in relation to each other, so the larger image (hour) can be at 0,0, and the smaller image (minutes) should be centered within the hour's dimensions (59,59).

- Don't use ImageRotate for the Hour rotator. That seems to have a very different effect from what you need. Instead, either adjust the StartAngle so that the meter starts pointing upward, or - better still - use an image editing program to straighten the image.

- Those ImageTints aren't doing anything at all.
That makes it work.
Be one of the iNEViTABLES - Storm, Earthquake, Lightning, Flood - and the world will bow down to you.

My current desktop
[hsimg]http://i1313.photobucket.com/albums/t559/TweaknFreak/6-22-20149-46-40PM_zps7bcbc1f6.png[/hsimg]
User avatar
TweaknFreak
Posts: 217
Joined: July 14th, 2012, 7:26 am

Re: 3rd Gig

Post by TweaknFreak »

MerlinTheRed wrote:damn. I never would have thought that ImageRotate has anything to do with this. I tried fixing it and was baffled that I had to use offsetx/y=272 so the hour rotates around its center. I guess the ImageRotate changes the effective size of the image before the offset is applied.
now that is something every one of us should be aware right from this time.
Be one of the iNEViTABLES - Storm, Earthquake, Lightning, Flood - and the world will bow down to you.

My current desktop
[hsimg]http://i1313.photobucket.com/albums/t559/TweaknFreak/6-22-20149-46-40PM_zps7bcbc1f6.png[/hsimg]