Hi all,
I've created a header for my card by placing a blank button and filling it with the background of the image. Seems to work well, however I would like the header to stretch horizontally along if the user decides to stretch the window. Is there a way I can create a header graphic that stretches an shrinks horizonrally according to the size if the window?
Many thanks
Jalz
Resizing header graphic
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Re: Resizing header graphic
Try something like this in the script of the first card of the stack:
But note that images don't scale very quickly, so this may appear a bit jerky.
Code: Select all
on resizestack
lock screen
set the width of image 1 to the width of me
set the top of image 1 to the top of me
set the left of image 1 to the left of me
unlock screen
end resizestack
Re: Resizing header graphic
Thanks mweider for starting me off.
After a little trial and error and looking at the dictionary to find out how things work - the following code seems to work quite nicely.
After a little trial and error and looking at the dictionary to find out how things work - the following code seems to work quite nicely.
Code: Select all
on resizestack
lock screen
set the width of button "button 1" to the width of me
set the top of button "button 1" to 0
set the left of button "button 1" to 0
unlock screen
end resizestack
Re: Resizing header graphic
The resizeStack message also includes two parameters which are the width and height of the stack. So an alternate way to do this would be:
on resizestack x,y -- these params are sent by the engine
lock screen
set the width of button "button 1" to x
set the topleft of button "button 1" to 0,0
unlock screen
end resizestack
on resizestack x,y -- these params are sent by the engine
lock screen
set the width of button "button 1" to x
set the topleft of button "button 1" to 0,0
unlock screen
end resizestack
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com