It is currently May 2nd, 2024, 4:47 pm

CrossHair Clock

Get help with creating, editing & fixing problems with skins
huckfh
Posts: 15
Joined: July 21st, 2011, 2:08 pm

CrossHair Clock

Post by huckfh »

Hi guys,

First of all i have to thank jsmorley for this: http://rainmeter.net/forum/viewtopic.php?f=27&t=6334
seriously i love you man :thumbup: i was thinking about making a clock with that kind of "seconds", since i'm a total newbie about rainmeter coding, in the past like in this time i was usual to mess with the others code for making something for myself, the most of the times i drop the "projects" since i'm kinda slow, and lazy :oops: and sometimes i lose interest in the skin that i started so....but anyways i don't want to bore you too much; just THANK YOU SO MUCH. I was totally stuck after many research around the web, and in this forum too, but thanks to google as well i found your awesome topic and it saved me, so after 1 day an half of "working" this is the result at the moment:

Image

it's based on a Sniper Rifle Scope from Battlefield 3:



probably it could look very primitive for the most of people, but i was searching to reproduce almost exactly the crosshair of the scope, so i changed the number of the scope with the clocks and the date, also i have to thank macro-love the creator of Pixellance Theme cause thanks to his code i was able to add the world clock and the date on this one.

I'm opening this topic not just for sharing , since i don't think is anything special to share, ( but i'm still very proud of myself after many efforts :D ) so i'm looking for a little but precious help, i am trying to add a "background image" to this "clock" but when i add it the result is this:

Image

i tried to find something wrong in the code, but i was unable to fix it, and as you can see the "Lens" is cropped on the left-top corner, so i hope that someone could give me a hand, thank you in advance, and feel free to write me any kind of constructive critique, or advice that might help me in this skin.

The code of the skin:

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1

[Metadata]
Name=CrossHairClock
Config=SecondDots
Description= A crosshair clock inspired to the PSO-1 scope from Battlefield 3
Instructions=
Version=1
Tags= Clock | World Clock | Date
Credits= HuckFH (images and code adaptation) jsmorley (SecondsDots code) & macro-love (Pixellance Date/World Clock code)
License=
Variant=
Preview=

[Variables]
12hr=%H                               %M
2ndClock=%H
3rdClock=%M
ImageTint=255,228,179,255
LineColor=255,0,0,150

[MeasureTime]
Measure=Time
Format=#12hr#

[MeasureTime2]
Measure=Time
Format=#2ndClock#
Timezone=+8.0
DaylightSavingTime=0

[MeasureTime3]
Measure=Time
Format=#3rdClock#
Timezone=+8.0
DaylightSavingTime=0

[MeasureSeconds]
Measure=Time
Format=%S

[MeasureMakeSecondsNumber]
Measure=Calc
Formula=MeasureSeconds 


[MeasureMonth]
Measure=Time
Format=%B
Substitute="January":"01","February":"02","March":"03","April":"04","May":"05","June":"06","July":"07","August":"08","September":"09","October":"10","November":"11","December":"12"

[MeasureDay]
Measure=Time
Format=%d

[MeasureYear]
Measure=Time
Format=%y


[MeasureWeek]
Measure=Time
Format=%A
Substitute="Monday":"1.7","Tuesday":"2.7","Wednesday":"3.7","Thursday":"4.7","Friday":"5.7","Saturday":"6.7","Sunday":"7.7"


[MeterCrossHair]
Meter=Image
ImageName=#CURRENTPATH#CrossHair.png
X=0
Y=0



[MeasureLine]
Measure=Calc
Formula=1

[MeterRedLine]
Meter=Image
X=(2.8 *[MeasureSeconds]+57)
Y=23r
SolidColor=#LineColor#
W=4
H=30
DynamicVariables=1


[MeterTimeDisplay]
Meter=String
MeasureName=MeasureTime
X=43
Y=54
FontFace=Trebuchet MS
FontSize=12
FontColor=0,0,0,255
StringStyle=Bold
StringCase=Upper
StringAlign=Left
AntiAlias=1

[MeterTimeDisplay2]
Meter=String
MeasureName=MeasureTime2
X=0
Y=66r
FontFace=Trebuchet MS
FontSize=12
FontColor=0,0,0,255
StringStyle=Bold
StringCase=Upper
StringAlign=Left
AntiAlias=1

[MeterTimeDisplay3]
Meter=String
MeasureName=MeasureTime3
X=22
Y=-4r
FontFace=Trebuchet MS
FontSize=12
FontColor=0,0,0,255
StringStyle=Bold
StringCase=Upper
StringAlign=Left
AntiAlias=1



[MeterWorld]
Meter=String
X=0
Y=165
FontFace=Trebuchet MS
FontSize=8
FontColor=0,0,0,255
StringStyle=Bold
StringCase=Upper
StringAlign=Left
Prefix="Guangzhou"
AntiAlias=1


[MeterDate]
MeasureName=MeasureDay
Meter=String
X=54
Y=104
FontFace=Trebuchet MS
FontSize=12
FontColor=0,0,0,255
StringStyle=Bold
StringCase=Upper
StringAlign=Left
AntiAlias=1


[MeterMonth]
MeasureName=MeasureMonth
Meter=String
X=80
Y=88
FontFace=Trebuchet MS
FontSize=12
FontColor=0,0,0,255
StringStyle=Bold
StringCase=Upper
StringAlign=Left
AntiAlias=1



[MeterYear]
MeasureName=MeasureYear
Meter=String
X=105
Y=68
FontFace=Trebuchet MS
FontSize=12
FontColor=0,0,0,255
StringStyle=Bold
StringCase=Upper
StringAlign=Left
AntiAlias=1



[MeterWeek]
MeasureName=MeasureWeek
Meter=String
X=106
Y=134
FontFace=Trebuchet MS
FontSize=12
FontColor=0,0,0,255
StringStyle=Bold
StringCase=Upper
StringAlign=Left
AntiAlias=1





The line that i'm trying to add:


Code: Select all

[BackGround]
Meter=IMAGE
ImageName=#CURRENTPATH#image.png

Edit:

Confused Explanation of the Numbers:

Image
User avatar
gmvolk
Posts: 56
Joined: September 26th, 2011, 11:02 pm

Re: CrossHair Clock

Post by gmvolk »

One thing I can think of to try is the H and W on the background image. That or make your image bigger/smaller to begin with. The other thing would be to play around with the x,y for the [meterCrossHair] and other meters, basically move all the time meters down and over, while the background image stays at 0,0. I hope this makes sense? Otherwise, it's a pretty cool idea, I can see a theme based around that!
"Pub." Ah, yes: a meeting place where people attempt to achieve advanced states of mental incompetence by the repeated consumption of fermented vegetable drinks.

http://gmvolk.deviantart.com/
huckfh
Posts: 15
Joined: July 21st, 2011, 2:08 pm

Re: CrossHair Clock

Post by huckfh »

gmvolk wrote:One thing I can think of to try is the H and W on the background image. That or make your image bigger/smaller to begin with. The other thing would be to play around with the x,y for the [meterCrossHair] and other meters, basically move all the time meters down and over, while the background image stays at 0,0. I hope this makes sense? Otherwise, it's a pretty cool idea, I can see a theme based around that!
thank you for your answer, and your help, i have tried changing the H and W and also playing with x,y but it still cropping the "Lens" , i was thinking about making a single image for this skin , probably should be easier, or probably should the images have the same dimension? i mean it looks like the first image (Crosshair) it crops the second one cause his dimension is smaller. Thanks for your compliment as well, my main idea is to make a BF3 theme based, especially on the Recon class.
Also i would know how centering perfectly both the images, while making the Lens ovverride the Crosshair; and in the end i would centering this skin exactly in the middle of my screen, so if someone can helps me i'll appreciate it a lot.
User avatar
gmvolk
Posts: 56
Joined: September 26th, 2011, 11:02 pm

Re: CrossHair Clock

Post by gmvolk »

The only other thought would be the order in which the meters are in the ini file. I was creating a skin and adding in a new meter, and it shifted the old meters over. Took me a few hours tweaking the x and y to no avail. As soon as I put the new meter before the old one, everything was perfect. Try to switch the order and see if that helps any.

Good luck! :beer:
"Pub." Ah, yes: a meeting place where people attempt to achieve advanced states of mental incompetence by the repeated consumption of fermented vegetable drinks.

http://gmvolk.deviantart.com/
huckfh
Posts: 15
Joined: July 21st, 2011, 2:08 pm

Re: CrossHair Clock

Post by huckfh »

gmvolk wrote:The only other thought would be the order in which the meters are in the ini file. I was creating a skin and adding in a new meter, and it shifted the old meters over. Took me a few hours tweaking the x and y to no avail. As soon as I put the new meter before the old one, everything was perfect. Try to switch the order and see if that helps any.

Good luck! :beer:
thank you very much! i will try it, i hope it will works!



edit: i tried to put the lens before the crosshair like this without any success :

Code: Select all

[MeterLens]
Meter=Image
ImageName=#CURRENTPATH#ScopeLens.png



[MeterCrossHair]
Meter=Image
ImageName=#CURRENTPATH#CrossHair.png

but the CrossHair it's still cropping the Lens on the left-top corner :-(
User avatar
gmvolk
Posts: 56
Joined: September 26th, 2011, 11:02 pm

Re: CrossHair Clock

Post by gmvolk »

:???: Hmmm, well if you could, can you package up what you've got and attach it to a reply. Without all the images I can only guess at this point. If I had everything your working with I may be able to spot something. Otherwise an expert would have to chime in.
"Pub." Ah, yes: a meeting place where people attempt to achieve advanced states of mental incompetence by the repeated consumption of fermented vegetable drinks.

http://gmvolk.deviantart.com/
huckfh
Posts: 15
Joined: July 21st, 2011, 2:08 pm

Re: CrossHair Clock

Post by huckfh »

Here we go, thanks for the help =)
You do not have the required permissions to view the files attached to this post.
User avatar
gmvolk
Posts: 56
Joined: September 26th, 2011, 11:02 pm

Re: CrossHair Clock

Post by gmvolk »

OK, you for sure just need to play with the X's and Y's. I added this section just after the variables

Code: Select all

[BackGround]
Meter=Image
ImageName=#CURRENTPATH#ScopeLens.png
then changed

Code: Select all

[MeterCrossHair]
Meter=Image
ImageName=#CURRENTPATH#CrossHair.png
X=55
Y=75
That brings some stuff in line, but you'll have to adjust the X,Y in all the other meters too.

Good luck, look forward to seeing what else you do.
"Pub." Ah, yes: a meeting place where people attempt to achieve advanced states of mental incompetence by the repeated consumption of fermented vegetable drinks.

http://gmvolk.deviantart.com/
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5407
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: CrossHair Clock

Post by eclectic-tech »

[edit] I just saw GMVOLK's reply, but I will add this for your use if you want...

Your image is cropped because of how you placed your meters; there is not enough room to display your sight image, it is larger than the spacing on your first meter...

I took what you had, created a 400x400 image of the view sight and a 400x400 image of the crosshairs... You can copy and use these if you want:

Then I edited your code, moved both images to the top, then set all meters relative to the placement of the top red moving bar gauge...

Edit the X+Y values of the 'MeterRedLine' meter to position all other meters; with different images you may need to tweak the relative positions of the other meters, but they should be very close to these values.

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1

[Metadata]
Name=CrossHairClock
Config=SecondDots
Description= A crosshair clock inspired to the PSO-1 scope from Battlefield 3
Instructions=
Version=1
Tags= Clock | World Clock | Date
Credits= HuckFH (images and code adaptation) jsmorley (SecondsDots code) & macro-love (Pixellance Date/World Clock code)
License=
Variant=
Preview=

[Variables]
12hr=%H                               %M
2ndClock=%H
3rdClock=%M
ImageTint=255,228,179,255
LineColor=255,0,0,150

[MeasureTime]
Measure=Time
Format=#12hr#
DynamicVariables=1

[MeasureTime2]
Measure=Time
Format=#2ndClock#
Timezone=+8.0
DaylightSavingTime=0
DynamicVariables=1

[MeasureTime3]
Measure=Time
Format=#3rdClock#
Timezone=+8.0
DaylightSavingTime=0
DynamicVariables=1

[MeasureSeconds]
Measure=Time
Format=%S

[MeasureMakeSecondsNumber]
Measure=Calc
Formula=MeasureSeconds 


[MeasureMonth]
Measure=Time
Format=%B
Substitute="January":"01","February":"02","March":"03","April":"04","May":"05","June":"06","July":"07","August":"08","September":"09","October":"10","November":"11","December":"12"

[MeasureDay]
Measure=Time
Format=%d

[MeasureYear]
Measure=Time
Format=%y


[MeasureWeek]
Measure=Time
Format=%A
Substitute="Monday":"1.7","Tuesday":"2.7","Wednesday":"3.7","Thursday":"4.7","Friday":"5.7","Saturday":"6.7","Sunday":"7.7"


[MeasureLine]
Measure=Calc
Formula=1

; Meter

[Background]
Meter=Image
SolidColor=0,0,0,1
H=400
W=400

[MeterSight]
Meter=Image
ImageName=#@#Images\Sight.png
X=0
Y=0

[MeterCrossHair]
Meter=Image
ImageName=#@#Images\CrossHair0.png
X=0
Y=0


[MeterRedLine]
Meter=Image
X=(2.8 *[MeasureSeconds]+115)
Y=105r
SolidColor=#LineColor#
W=4
H=30
DynamicVariables=1


[MeterTimeDisplay]
Meter=String
MeasureName=MeasureTime
X=102
Y=28r
FontFace=Trebuchet MS
FontSize=12
FontColor=0,0,0,255
StringStyle=Bold
StringCase=Upper
StringAlign=Left
AntiAlias=1
DynamicVariables=1

;////////////////////////
[MeterYear]
MeasureName=MeasureYear
Meter=String
X=62r
Y=15r
FontFace=Trebuchet MS
FontSize=12
FontColor=170,170,170,255
StringStyle=Bold
StringCase=Upper
StringAlign=Left
AntiAlias=1

[MeterMonth]
MeasureName=MeasureMonth
Meter=String
X=-26r
Y=20r
FontFace=Trebuchet MS
FontSize=12
FontColor=170,170,170,255
StringStyle=Bold
StringCase=Upper
StringAlign=Left
AntiAlias=1

[MeterDate]
MeasureName=MeasureDay
Meter=String
X=-27r
Y=19r
FontFace=Trebuchet MS
FontSize=12
FontColor=170,170,170,255
StringStyle=Bold
StringCase=Upper
StringAlign=Left
AntiAlias=1


[MeterTimeDisplay3Min]
Meter=String
MeasureName=MeasureTime3
X=-30r
Y=12r
FontFace=Trebuchet MS
FontSize=12
FontColor=0,170,0,255
StringStyle=Bold
StringCase=Upper
StringAlign=Left
AntiAlias=1
DynamicVariables=1


[MeterTimeDisplay2Hr]
Meter=String
MeasureName=MeasureTime2
X=-24r
Y=6r
FontFace=Trebuchet MS
FontSize=12
FontColor=0,170,0,255
StringStyle=Bold
StringCase=Upper
StringAlign=Left
AntiAlias=1
DynamicVariables=1



[MeterWeek]
MeasureName=MeasureWeek
Meter=String
X=107r
Y=12r
FontFace=Trebuchet MS
FontSize=12
FontColor=0,0,0,255
StringStyle=Bold
StringCase=Upper
StringAlign=Left
AntiAlias=1


[MeterWorld]
Meter=String
X=-100r
Y=30r
FontFace=Trebuchet MS
FontSize=8
FontColor=0,0,0,255
StringStyle=Bold
StringCase=Upper
StringAlign=Left
Prefix="Guangzhou"
AntiAlias=1

With the above images and code you should get this:


I changed the color of your text to allow me to position them correctly. By making slight adjustments to the relative positions, you should be able to get what you want. I also added 'Dynamicvariables=1' to several measures and meters using those measures because they contained variables.

Hope this helps.
BlizZ4rdz
Posts: 1
Joined: December 2nd, 2012, 9:59 am

Re: CrossHair Clock

Post by BlizZ4rdz »

Sorry for interrupting....i found this link yesterday...and i manage to fix the problem.....and i also make a 50% smaller crosshair for addition...pls do try it. :D
You do not have the required permissions to view the files attached to this post.