Can cards in a stack be of different sizes
Wilhelm Sanke
sanke at hrz.uni-kassel.de
Mon Nov 3 12:52:07 EST 2003
On Sun, 2 Nov 2003, Alex Rice <alex at mindlube.com wrote:
> On Nov 2, 2003, at 3:46 PM, Wilhelm Sanke wrote:
> > Sure, they can:
> >
> > Have a look at the Glossary stack. All cards have different sizes.
> >
> > In the preopencard handler you may find some hints:
> >
> (snip)
>
> I've looked, and I have no idea where you pulled that code from. What
> you show above is just "change the size of the stack window as we go
> along". So yes, you can fake it but the stack has to be resized by
> scripting, right?
>
> Alex Rice
>
As I indicated, I pulled the code from the preopencard handler, but this
handler is contained in the *stack* script of stack "revdocsglossary".
Here is another example of the implementation of a stack with different
card sizes:
- set the backdrop to black (or any color)
- create a black transition card in your stack
- store the height of the individual card in a custom property
- navigate from one marked card to the other
========================
stack script of the sample stack:
on preopenstack
set the loc of me to the screenloc
set the backdrop to black
go to card "black"
end preopenstack
on openstack
visual effect barn door open
set the height of this stack to the cdheight of cd 1
go to cd 1
end openstack
=========================
forward button of navigation group on each card:
on mouseUp
put the cdheight of next marked cd into newheight
put the ID of the next marked cd into cardID
put the top of this stack into savedtop
visual effect wipe right slowly to black
go to card "black"
set the height of this window to newheight
set the top of this stack to savedtop
visual effect wipe left slowly
go to cd ID cardID
end mouseUp
======================================
The last script assumes that the top of the stack should remain at the
same loc.
If you want to center each card then substitute "set the top of this
stack to savedtop" by "set the loc of this stack to the screenloc" - or
set the loc of the stack to any other central point for the stack.
Regards,
Wilhelm Sanke
More information about the use-livecode
mailing list