It is currently May 2nd, 2024, 1:24 pm

Forcing images to align with a bar

Get help with creating, editing & fixing problems with skins
User avatar
Ninjashizzle
Posts: 9
Joined: July 31st, 2012, 4:02 am

Forcing images to align with a bar

Post by Ninjashizzle »

Hey guys, I posted a couple of days ago about my WIP Minecraft skin. I have now made a launcher bar and want to put the icons/buttons in the spaces. How do I make it so the buttons are set to the right places when the bar is loaded?

So far it looks like this, with an icon in a separate file for demonstration put in place manually.


And this is what I've done so far.

Bar

Code: Select all

[Rainmeter]
Update=1000
Author=Ninjashizzle
BackgroundMode=0

;...........................................................................
;Variables
;...........................................................................

[Variables]
Button1Path=C:\Program Files (x86)\Notepad++\notepad++.exe

;...........................................................................
;Meter
;...........................................................................

[BarImage]
Meter=IMAGE
ImageName=#ROOTCONFIGPATH#Shortcut Bar\Shortcut Bar.png
X=0
Y=0
H=61
W=546
AntiAlias=1
Button

Code: Select all

[Rainmeter]
Update=1000
Author=Ninjashizzle
BackgroundMode=0

;...........................................................................
;Variables
;...........................................................................

[Variables]
Button1Path=C:\Program Files (x86)\Notepad++\notepad++.exe

;...........................................................................
;Meter
;...........................................................................

[Button1]
Meter=IMAGE
ImageName=#ROOTCONFIGPATH#Shortcut Bar\Buttons\Sword.png
AntiAlias=1
LeftMouseUpAction=!Execute ["#Button1Path#"][!Update]
I know that I'll have to combine the two, it's just a matter of knowing how to position the icons without guessing the right places.
User avatar
UnforgivenRevival
Posts: 310
Joined: June 7th, 2012, 2:25 am
Location: Philadelphia, PA

Re: Forcing images to align with a bar

Post by UnforgivenRevival »

Theres a free program called PixelRuler, Helps take alot of the guesswork out of where to place things, But you will still have to fine tune with it. "r" positions help alot also, Use them where-ever you can.

For example:

Code: Select all


[Blah]
Meter=Image
x=25
y=25

[Blah2]
Meter=Image
x=25r
y=r

[Blah3]
Meter=Image
x=25r
y=r

User avatar
Ninjashizzle
Posts: 9
Joined: July 31st, 2012, 4:02 am

Re: Forcing images to align with a bar

Post by Ninjashizzle »

UnforgivenRevival wrote:Theres a free program called PixelRuler, Helps take alot of the guesswork out of where to place things, But you will still have to fine tune with it. "r" positions help alot also, Use them where-ever you can.

For example:

Code: Select all


[Blah]
Meter=Image
x=25
y=25

[Blah2]
Meter=Image
x=25r
y=r

[Blah3]
Meter=Image
x=25r
y=r

Can you tell me more about the "r" position? I've used it before but can't say I really understood what it means/does.
User avatar
UnforgivenRevival
Posts: 310
Joined: June 7th, 2012, 2:25 am
Location: Philadelphia, PA

Re: Forcing images to align with a bar

Post by UnforgivenRevival »

The "r" position means the relative position to the meter above. You use it to align items.

this is whats stated in the manual:
X
The X-position of the meter inside the window. The coordinates can be made relative to the previous meter by adding 'r' to the end of the number (e.g. X=5r). You can also use capital R which makes the position relative to the right edge of the previous meter.
Y
The Y-position of the meter inside the window. The coordinates can be made relative to the previous meter by adding 'r' to the end of the number (e.g. Y=-10r). You can also use capital R which makes the position relative to the bottom edge of the previous meter.
in your case, Youd have the y position the same for all your icons going into the boxes, So all you would have to enter is y=r for each image. You can simplify the spacing for the x position for each icon with something like x=25r, or x=10r, Or even x=5R, Depending on what spacing is needed. This makes life alot easier than manually entering an x coordinate for each image.
User avatar
Ninjashizzle
Posts: 9
Joined: July 31st, 2012, 4:02 am

Re: Forcing images to align with a bar

Post by Ninjashizzle »

Ahh I get it now, thanks for the help.
User avatar
UnforgivenRevival
Posts: 310
Joined: June 7th, 2012, 2:25 am
Location: Philadelphia, PA

Re: Forcing images to align with a bar

Post by UnforgivenRevival »

No problem. :)