Page 1 of 1

visual effect group

Posted: Thu Jun 23, 2011 5:17 am
by jesse
is it possible to take a group that is not visible and slide it into view? how? i tried this with no success

Code: Select all

on mouseup
   visual effect push group  "menu" right fast
   set the visible of group "menu" to true
end mouseup

Re: visual effect group

Posted: Thu Jun 23, 2011 11:01 am
by Klaus
Hi jesse,

where did you get that syntax from?
The docs are really clear about this!
...
show grp "menu" with visual effect push right fast
...


Best

Klaus

Re: visual effect group

Posted: Thu Jun 23, 2011 3:07 pm
by jesse
sorry... i'm still getting used to the code. i copied it partly from the ticked off project from summer academy but of course it didn't, work. thank you for your help though.

Re: visual effect group

Posted: Thu Jun 23, 2011 3:40 pm
by jesse
another question... if this will show a group how to do i get a group to hide when the mouse leaves the group.

Code: Select all

on mouseUp
   show grp "test" with visual effect push right fast
end mouseUp
i tried this to hide a group with three buttons that have a surrounding rectangle but it hid the group everytime i moused between the buttons
within the group even. am i missing something?

on mouseLeave
hide grp "test" with visual effect push right fast
end mouseLeave

Re: visual effect group

Posted: Thu Jun 23, 2011 4:04 pm
by Klaus
Hi jesse,

what's in the script of these three buttons?

Re: visual effect group

Posted: Thu Jun 23, 2011 5:44 pm
by jesse
nothing is in the script of the three buttons. only a script in the group as mentioned above.

Re: visual effect group

Posted: Thu Jun 23, 2011 5:52 pm
by dglass
It has been my experience that any transparent/empty space in a group is not considered part of the group.

You can test this by putting an 'answer' call in a mouseleave handler of the group. It will only fire when the mouse leaves the bounds of an object in the group, not when it leaves any of the space around the objects.

The workaround is to put an opaque rectangle over the group, and set its blend to 'noop'. At least I think that's the solution, I'll have to check one of my test stacks to verify.

Re: visual effect group

Posted: Thu Jun 23, 2011 7:03 pm
by SparkOut
That's the solution, except make the graphic with noop ink mode blend to be a backdrop to the group, otherwise I think it will mask mouse click events for the visible buttons.

Re: visual effect group

Posted: Thu Jun 23, 2011 7:09 pm
by jesse
I tried that creating a rectangle, opaque, and blend noop. i used the below code on the group.
but the answer stil fires when i mouse between the buttons or elements in the group even though
im still within the confines of the rect. any other ideas?

Code: Select all

on mouseleave
   answer "goodbye"
end mouseleave

Re: visual effect group

Posted: Fri Jun 24, 2011 1:24 am
by SparkOut
It really does work, honestly. Try this...
I put empty rectangle graphics around the buttons just so you could see where the groups were.

Re: visual effect group

Posted: Fri Jun 24, 2011 4:02 am
by jesse
where did you set a background graphic with ink set to noop?

Re: visual effect group

Posted: Fri Jun 24, 2011 8:20 am
by SparkOut
Within the bounds of the rectangle graphic in the lower group. I should have given them separate names to make it clearer. If you use the Application Browser you should see two rectangle graphics in the lower of the groups, one is identical to the rectangle of the upper group, not set to opaque. Both of those are only there to show the area where the mouse should have an effect on the group, not for any functionality. The lower group has a second rectangle graphic set to be the lowest layer within that group of an identical size and position to the one with the border "frame". That is the one set to be opaque with the ink set to "noop" under "blending" in the property inspector. You are probably having a hard time trying to pick it up by the pointer tool in the IDE. Try using the Application Browser.

Re: visual effect group

Posted: Fri Jun 24, 2011 10:13 am
by SparkOut
I revised the test stack and gave the rectangle graphics different names.
I also put a script in the buttons of the lower group "select graphic 1 of the owner of me" which means if you click it the 1st graphic (the MessageCatcher graphic, as it's the lowest layer in the group) of the owner of the button (the owner being the group containing the buttons along with the MessageCatcher) will be selected. Then you can choose the property inspector to see the actual properties of that graphic.
I also changed the buttons so that the left two set the ink of the MessageCatcher to "srcCopy" which is the standard blend mode ink setting - ie it will display its own colour without any other effects or interference from other screen objects' colours. The right two buttons set the ink back to "noop" which means that the graphic will still be there, and still be rendered and available for catching messages, but not visible by eye.

Re: visual effect group

Posted: Mon Jun 27, 2011 7:47 pm
by jesse
Thanks a bunch. I'll play around with this example more.