It is currently April 19th, 2024, 9:11 pm

Need Help with Rotator Image

Get help with creating, editing & fixing problems with skins
gone369
Posts: 6
Joined: August 18th, 2010, 8:02 am

Need Help with Rotator Image

Post by gone369 »

Hi, I've been working on my new clock skin lately and I've come across a problem. I would appreciate any advice.

Code: Select all

[Variables]
Height=460
Width=460


[MeterPointer]
MeasureName=MeasureTime
Meter=ROTATOR
StartAngle=[MeasureRadians]
RotationAngle=2.083333333
ValueReminder=60
X=-72
Y=0
W=#Width#
H=#Height#
ImageName=pointer.png
OffsetX=159
OffsetY=229
DynamicVariables=1
I'm trying to make a clock that's able to rescale to whatever dimensions the user sets. I've been able to rescale all my other image meters, but I've found the image for the ROTATOR meter cannot rescale itself. Changing the H and W will only affect the center of rotation, but will not rescale the image (pointer.png). Is there any way to rescale the image in the rotator meter?
Aarowaim
Posts: 97
Joined: July 25th, 2010, 7:23 am

Re: Need Help with Rotator Image

Post by Aarowaim »

That's because the center of rotation is contained in offsetX and offsetY. If you were to resize the image to 100x100, it would still rotate from a point 159 pixels right and 229 pixels above the center of the image (refer to this attachment:
Your image.png
to see as an image). If you want it to rotate from the proper point, you'll have to add a calculation to scale your OffsetX and OffsetY.
For your OffsetY, it would seem that you want the offset equal to half the total size, so change the OffsetY to OffsetY=#Height#/2 and your OffsetX seems to be about 34.75% of your width, so OffsetX=ROUND(#Width#*0.3478260869565217391304347826087) (I made it as accurate as possible so that it should stay at the right spot. also, I rounded it because there is no such thing as half a pixel)

Code: Select all

[Variables]
Height=460
Width=460

[MeterPointer]
MeasureName=MeasureTime
Meter=ROTATOR
StartAngle=[MeasureRadians]
RotationAngle=2.083333333
ValueReminder=60
X=-72
Y=0
W=#Width#
H=#Height#
ImageName=pointer.png
OffsetX=ROUND(#Width#*0.3478260869565217391304347826087)
OffsetY=#Height#/2
DynamicVariables=1
If this doesn't work, it's because the meter doesn't support certain calc functions. To fix this problem if it does come up, just make a calc measure for each of these two formulas and put the name of the corresponding calc into OffsetX and OffsetY (Exactly like how you put StartAngle=[MeasureRadians].
You do not have the required permissions to view the files attached to this post.
Away for a while :(
Programming isn't a hobby, it's a lifestyle choice.
[url=http://www.rainmeter.net/forum/viewtopic.php?f=83&t=1207][b]T34M V.1.5.0.|2[/b][/url] <----I'ts l33t, look it up

Coding Skills: [color=#00FFFF]4.5[/color]
Answering Skills: [color=#00FFFF]4[/color]
Image Editing: [color=#00FFFF]3[/color]
Knowledge: [color=#00FFFF]4.5[/color]
Technical Skills: [color=#00FFFF]3[/color]
gone369
Posts: 6
Joined: August 18th, 2010, 8:02 am

Re: Need Help with Rotator Image

Post by gone369 »

Hey, Thanks for your advice and even making a picture to help visually, but I'm sorry to tell you that your answer wasn't exactly what I wanted to question. I promise I'll make the question clearer this time.

Here's my new code, so no more weird X Y or height and width values. Just plain 600 by 600 image with X=0 Y=0.

Code: Select all

[Variables]
Height=600
Width=600

[MeasureOffsetX]
Measure=Calc
Formula=(#Width#/2)

[MeasureOffsetY]
Measure=Calc
Formula=(#Height#/2)

[MeterPointer]
MeasureName=MeasureTime
Meter=ROTATOR
StartAngle=[MeasureRadians]
RotationAngle=-2.083333333
ValueReminder=60
X=0
Y=0
W=#Width#
H=#Height#
ImageName=pointer.png
OffsetX=[MeasureOffsetX]
OffsetY=[MeasureOffsetY]
DynamicVariables=1
Ok..so the center of rotation is at 300,300. and the original pointer.png inside my skin folder is 600X600 reso.

My Clock looks fine, when the background and everything is at 600X600 (H=600 W=600), but since my goal is to create a resizable clock, I want everything to decrease or increase in dimension when I change the variables H and W.

Let's say for now I want to change the dimensions to: H=400 W=400.

But the problem is, for the ROTATOR meter, I cannot change the point.png image's resolution (not the center of rotation). SO.. when I try to change the H and W to 400, the center of rotation will move to 200,200 but the pointer.png in [MeterPointer] will not rescale to 400X400.
1st. My pointer will not resize itself, causing my second hand to protrude out of the rim of the clock if I make the resolution < 600X600
2nd. This causes my pointer.png to rotate at the wrong center (200,200) because my pointer.png is still in 600X600 resolution

(You can ignore the 2nd problem, I've found a solution)

My question is now, how do I resize the 600X600 pointer.png image in the ROTATOR meter as if you would resize an image in a regular IMAGE meter? because changing the height and width of the ROTATOR meter will not change the size of the image in the meter.

Any help advice or solutions will be appricated. If there's no way to resize the image in the rotator meters let me know as well.

Thanks again.
gone369
Posts: 6
Joined: August 18th, 2010, 8:02 am

Re: Need Help with Rotator Image

Post by gone369 »

Nvm. I got it. I guess you could stick a transformation matrix into the Rotator Meter. And It'll resize or rescale the image for you.

Case Closed
Aarowaim
Posts: 97
Joined: July 25th, 2010, 7:23 am

Re: Need Help with Rotator Image

Post by Aarowaim »

Thank you for taking the time to correct my misunderstanding. I am very happy that you found the answer to this and if you ever need any more help, don't be afraid to ask.
Away for a while :(
Programming isn't a hobby, it's a lifestyle choice.
[url=http://www.rainmeter.net/forum/viewtopic.php?f=83&t=1207][b]T34M V.1.5.0.|2[/b][/url] <----I'ts l33t, look it up

Coding Skills: [color=#00FFFF]4.5[/color]
Answering Skills: [color=#00FFFF]4[/color]
Image Editing: [color=#00FFFF]3[/color]
Knowledge: [color=#00FFFF]4.5[/color]
Technical Skills: [color=#00FFFF]3[/color]