|
|
|
09-05-2017, 05:01 PM
|
#1
|
Human being with feelings
Join Date: Jan 2013
Posts: 648
|
WALTER. Is there a way to relative stretch width and height of element?
I will answer myself: Yes... but is there other way (easier)? Because this way of doing this will cause lot of brain pain later.
Code:
set btnwh - h 6
set tcp.mute \
- [783 3 btnwh btnwh 1 0 1 0] * h@x 2
set tcp.solo \
- [778 3 btnwh btnwh 1 0 1 0] h@x
|
|
|
09-06-2017, 01:49 AM
|
#2
|
Pixel Pusher
Join Date: Mar 2007
Location: Blighty
Posts: 4,951
|
Quote:
Originally Posted by strachupl
Code:
set btnwh - h 6
set tcp.mute \
- [783 3 btnwh btnwh 1 0 1 0] * h@x 2
set tcp.solo \
- [778 3 btnwh btnwh 1 0 1 0] h@x
|
Very nice. That would seem a good candidate for a macro:
Code:
;*** UNTESTED ***
macro relativeStretch element position
set btnwh - h 6
set baseWidth 5 ; or whatever your unstretched eleemnt width is
set element - - [783 3 btnwh btnwh 1 0 1 0] * basewidth@x position * h@x position
endmacro
relativeStretch tcp.mute 0
relativeStretch tcp.solo 1
Last edited by White Tie; 09-06-2017 at 03:47 AM.
|
|
|
09-06-2017, 05:02 AM
|
#3
|
Human being with feelings
Join Date: Nov 2015
Location: Germany
Posts: 1,015
|
HA, I think this will be my favorite thread ever!
Q: White Tie: what does "position" stand for?
Is it just a placeholder to be filled with coordinates or does this actually do anything?
Or is it just for this example?
Veeery curious...cause I'm working on this (the stretchy meter at the beginning/end of the gif):
Cheers,
Peter
|
|
|
09-06-2017, 08:36 AM
|
#4
|
Pixel Pusher
Join Date: Mar 2007
Location: Blighty
Posts: 4,951
|
Quote:
Originally Posted by Pet
Q: White Tie: what does "position" stand for?
|
Its a parameter of the macro. When you call the macro, you say...
Code:
macro name parameter1 parameter2
;blah blah code that does things to parameter1 and parameter2
endmacro
That macro has 2 parameters, so to use it I would type the macros name followed by 2 values that were to be processed by that macro.
So, if I wanted to write a macro called 'Steve' that added three numbers together and created a variable with the result, I could type:
Code:
macro Steve parameter1 parameter2 parameter3 variableName
set variableName + + parameter1 parameter2 parameter3
endmacro
; using it...
Steve 1 2 3 Dave
; I would now have a variable called Dave with the value of 6
More on Macro Arguments.
|
|
|
09-06-2017, 11:12 AM
|
#5
|
Human being with feelings
Join Date: Nov 2015
Location: Germany
Posts: 1,015
|
White Tie, thanks for explaining and the link.
I will investigate more of this. It's exciting and a lot of fun - but hard for a coding newbie.
Btw, searching a little more led my directly to a german wikipedia page...how nice!
|
|
|
09-08-2017, 01:58 AM
|
#6
|
Human being with feelings
Join Date: Jan 2013
Posts: 648
|
White Tie
Thanks for help, I have more brain pain now learning those macros
|
|
|
09-08-2017, 03:41 AM
|
#7
|
Human being with feelings
Join Date: Jan 2013
Posts: 648
|
Stretch both edges
I was playing arround to mix panel width and height to affect elements size. If someone interested:
Code:
set bwh14 14
set t1 * * - h 20 0.0025 * w 0.05
set tcp.recarm + [19 3 bwh14 bwh14] [0 0 t1 t1]
set bwh300 300
set t1 * * - h 20 0.0025 * w 0.05
set pxravr + + tcp.recarm{x} tcp.recarm{w} 1
set tcp.label + [pxravr{x} 3 bwh300 bwh14] [0 0 t1 t1]
Last edited by strachupl; 09-08-2017 at 03:58 AM.
|
|
|
09-08-2017, 04:22 AM
|
#8
|
Human being with feelings
Join Date: Nov 2015
Location: Germany
Posts: 1,015
|
In my case of the meter in the gif above it looks like this:
Code:
set squash / h [0 0 0.45 0 0 1 1 1]
set tcp.meter h<34 + squash@w [5 3 279 93 0 0 1 1]
|
|
|
09-08-2017, 11:18 PM
|
#9
|
Human being with feelings
Join Date: Jan 2013
Posts: 648
|
Problem
Code:
macro drawxwh element position
set sq14 14
set t1 * * - h 20 0.005 * - w 20 0.05
set trs * + + sq14@x t1@x 1@x position
set element + + + [19 3 sq14 sq14 0 0 0 0] [0 0 t1 t1] trs@x
endmacro
drawxwh tcp.recarm 0
drawxwh tcp.recmon 1
drawxwh tcp.recmode 2
White Tie
I think I know how these macros work. I made this macro and have a problem. Elements are jumpy for position from 2,3 etc...
I think it is because of t1 have fractions not whole numbers but why button on position 1 do not have problems and all later buttons have? Is there a way to fix it?
|
|
|
09-09-2017, 06:07 AM
|
#10
|
Pixel Pusher
Join Date: Mar 2007
Location: Blighty
Posts: 4,951
|
I don't know. As you correctly suggest, since WALTER only works in integer numbers of pixels then things are going to be pushed to their nearest value. Maybe the discrepancy between elements 2 and 3 is an even/odd thing, add something as element 5 to check?
Anyway, I would fix that by avoiding it...
Your gap is very small, so a shift of 1px on each value, if they happen in opposite directions at the same time, is a huge % of error relative to what you wanted. So, I'd either make it zero or make it bigger. Or, add a fixed gap on after you scale your elements, if that works for your design idea. You could also add a gap within your bitmaps. After all, if the eye doesn't read it as wrong, then in pure design terms it isn't wrong!
By the way, kudos for using blocks of solid colour when setting out your WALTER. Makes it so much easier to see what's going on, right?
|
|
|
09-09-2017, 06:56 AM
|
#11
|
Human being with feelings
Join Date: Jan 2013
Posts: 648
|
Quote:
Originally Posted by White Tie
I don't know. As you correctly suggest, since WALTER only works in integer numbers of pixels then things are going to be pushed to their nearest value. Maybe the discrepancy between elements 2 and 3 is an even/odd thing, add something as element 5 to check?
Anyway, I would fix that by avoiding it...
Your gap is very small, so a shift of 1px on each value, if they happen in opposite directions at the same time, is a huge % of error relative to what you wanted. So, I'd either make it zero or make it bigger. Or, add a fixed gap on after you scale your elements, if that works for your design idea. You could also add a gap within your bitmaps. After all, if the eye doesn't read it as wrong, then in pure design terms it isn't wrong!
By the way, kudos for using blocks of solid colour when setting out your WALTER. Makes it so much easier to see what's going on, right?
|
Thank you very much for help. Now I will investigate with your tips.
Yes, solid colour blocks are very helpful. I also often make printscreen and paste it to gimp to zoom and see more.
|
|
|
Thread Tools |
|
Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -7. The time now is 05:47 AM.
|