Stupid Pan Tricks

Probably useless, but the form has been pretty slow so I’ll put it out there anyway. Other than a novelty, I don’t know what use these live effects might be…maybe you can figure one out.

Gradient Effects

For the flashing button–
Make an Image Display Object to the size of a standard button and set the border to “None”. Set the formula to: “>>30°”+gradString2+{"}. Now create a Push Button object on top of the Image Display and set it to ‘Rounded Textured Button’ with any title you want. For the button code I have it set to have the cow moo for a second or two with the timer.

showvariables cowPoke 
starttimer "resetcow","repeat",1,"next",supernow()+2, "code",{cowPoke=""
showvariables cowPoke}

For the color changing border–
Use an Image Display Object as the background that is covered by the other objects except where you want the border to show. set the formula to “>>90°”+gradString+{"} or whatever gradient angle you prefer.

For the mouse activated color changing background–
Use another Image Display Object with the simple formula: triggerColor.

The code to create the timer that powers all this–

starttimer "Gradient","scope","window","interval",.5, "code",
    {define gradString,"FFFB00,FFD479,D4FB79"
    define gradString2,"CF9566,FF7E79,CF9566,FFFC79"
    define triggerColor,""
    define cowPoke,""
	objectinfo("rectangle", "background")),"%%589455","%%FFFFFF")
    showvariables gradString,gradString2,triggerColor,cowPoke}

Now whenever that form is active the button and border will have the animation. You can use whatever gradient colors you choose and set the angle of the gradient in the Image Displays as you desire. The timer is continually cycling through the gradient colors moving the last color to the front for one and the front to the last on the other at each pass. The timer also continually checks the position of the mouse and changes the background color if it is within the chosen rectangle.

One further note. It appears that if the timer is set to repeat using any value under 1 it will run almost continuously as fast as possible.

1 Like

You may not see it as high praise Gary but my six-year-old grandson loves it!

Definitely a young man of exquisite tastes!