Page 1 of 1

Container resizing with a Custom button ?

Posted: 02 Nov 2015 23:53
by Glennzone
Hey folks ! S'been awhile, but I've been able to fly solo for a period of time. Now, I've a manoevre I can't manage which requires some perspective.

I find I'm still kind of inept with the coding of scripts where I don't have a functional example to guide me through. The code I was trying is :

if(firstof(x)==0) {
setobjectrect(cKORE2audioFX, rect[0,273,1022,208]);
}
else {
setobjectrect(cKORE2audioFX, rect[0,81,1022,400]);
}

The button is intended to toggle the container between two different sizes.
I'm probably all screwy, but I know folks here will know better.

Looking forward to your input.

Thanks in advance for your perspective.
Glennzone

Re: Container resizing with a Custom button ?

Posted: 03 Nov 2015 00:48
by Phil999
I've done such things before, and looking at the code it should work.

I don't know right now where the problem lies, but it surely is only a typo or some other minor error. Try again with other means (for example with several if's).

Re: Container resizing with a Custom button ?

Posted: 03 Nov 2015 01:50
by Glennzone
I found it by looking at some other code. . . .

Stupid computers don't recognize spelling errors >?! :=D

"if(x==0) {
setobjectrect(cKORE2audioFX,{0,273,1022,208});
}
else {
setobjectrect(cKORE2audioFX,{0,81,1022,400});
}"


Thanks Phil. ;-)

Re: Container resizing with a Custom button ?

Posted: 03 Nov 2015 19:30
by Phil999
good that you found the solution.