Forum: Addons

Addons comments
Topic: Minimalist UX 4

geposted Mon 11 Jun 18 @ 12:53 pm
Hi Rune,

Is there any chance you can explain how to change the position of the elements in the XML ..... for example move the text or EQ up or down.

I had a quick look and it's not that simple to understand. For example "<pos x="+0" y="+60+6+20+70+20+6+20"/>"

Once explained it will be easier to modify these to suit individual requirements.


geposted Mon 11 Jun 18 @ 1:05 pm
Like in any skin, coordinates can be relative or absolute, and you can also use math functions (add and subtract)

When coordinates start with + or - they are relative coordinates (relative to the object they are inside, like a group or panel)
When the start directly with a number they are absolute (absolute to the top left corner of the skin)

When you see something like +5+20+50+30 it's the same as +105
When you see something like 20+30+10 it's the same as 60

The reason that on many skins you see coordinates with math functions is because it's easier for the skinner to align and position elements this way.

blockA (a line) height=5 pixels, position y=+0 ( 0 pixels from the parent group)
blockB (an EQ) height=50 pixels, position y=+0+5 (we add the height of the line)
blockC (a texzone) height =20 pixels, position y=+0+5+50 (we add the height of the previous block to it's y coordinates)
blockD (a second textzone) height=15 pixels, position y=+0+5+50+20 (same as above)

Of course in the example above we left no gaps between the blocks.
If we add gaps (let's say 10 pixels each) then the coordinates would be:
blockA y=+0
blockB y=+0+5+10
blockC y=+0+5+10+50+10
blaockD y=+0+5+10+50+10+20+10

With this code if the gap is too small (or too big) we can easily adjust it without recalculating all coordinates (e.g. replace +10 with +15)

blockA y=+0
blockB y=+0+5+15
blockC y=+0+5+15+50+15
blaockD y=+0+5+15+50+15+20+15

geposted Mon 11 Jun 18 @ 4:35 pm