It is currently May 4th, 2024, 7:03 pm

moving meter group?

Get help with creating, editing & fixing problems with skins
Alex Becherer

moving meter group?

Post by Alex Becherer »

a question:
is it possible to move all meters of a meter group meter group let's say 50 pixels to the right?
or will i have to move each meter?
or is this maybe a feature to come with the next betas?
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: moving meter group?

Post by jsmorley »

Alex Becherer wrote:a question:
is it possible to move all meters of a meter group meter group let's say 50 pixels to the right?
or will i have to move each meter?
or is this maybe a feature to come with the next betas?
No, !MoveMeter is not a "relative" command that would work with a group. It moves a meter to a specific X / Y position, so any group implementation would just put all meters in the same spot.

Currently there are not any plans to create some kind of new !MoveMeterRelative / !MoveMeterGroupRelative functionality, but you never know.
User avatar
Kaelri
Developer
Posts: 1721
Joined: July 25th, 2009, 4:47 am

Re: moving meter group?

Post by Kaelri »

There are a number of alternative methods:

- Use a common variable in each meter's X option, e.g. X=(#Variable#+10). Then change that variable to move all the meters.

- Using Section Variables, choose one meter as a base, then have all other meters follow the first meter, e.g. X=([MainMeter:X]+10).

- Load a simple Lua script with the following:

Code: Select all

function MoveBy(MeterName, X)
   local Meter = SKIN:GetMeter('MeterName')
   local OldX = Meter:GetX()
   local NewX = OldX + X
   SKIN:Bang('!SetOption', MeterName, 'X', NewX)
end
Then you can use this bang to move each meter by a certain distance, while maintaining their positions relative to each other:

Code: Select all

!CommandMeasure MeasureName "MoveBy('MeterName', X)
Alex Becherer

Re: moving meter group?

Post by Alex Becherer »

it's a little more complicated. i am already using section variables, but as the position and the visibility of a group is dependent on more than one variable moving the group as a whole have been convenient.
i mean, i know how to get this skin working, but the code will probably make you want to puke if you would see it :D

thanks a lot for the help :)