About WindowShape

Scott Rossi scott at tactilemedia.com
Tue Jun 3 02:16:01 EDT 2003


> I've spent a little time thinking about this.
>
> Perhaps the easiest solution is to create a 'dragRect' function in the MC
> engine. This would essentially create a 'dotted' rect which the user could
> drag the botRight of (could be useful for a lot of other things as well.)
> 
> So, to resize a stack, a button is placed in the botright and when
> clicked....
> 
> on mouseDown
> --if DragRect sees a tStartPoint, then it only looks for the mouseUp
> endpoint
> put the topLeft of this stack into tStartPoint
> 
> -- User drags the dottedline rect
> put dragRect(tStartPoint) into tEndPoint
> 
> -- Do the math to calculate the new width and height of the stack
> -- Basically subtract the X and Y values of tStartPoint from tEndPoint
> -- then you now have a new window size
> -- Now you can dynamically build a trans GIF or PNG quickly to set the
> windowShape to
> 
> end mouseDown

The "dynamically build a trans GIF or PNG..." is the part I have trouble
understanding. How do you envision doing this quickly enough to update the
window while the user is dragging?


> Another easy way to do this without a DragRect XFCN is ON MOUSEDOWN  set the
> windowShape to empty (I assume this results in a default window), drag it to
> the size you want, then ON MOUSEUP (finished dragging -- I know use
> mouseMove!) recalculate the WindowShape mask and apply. I haven't tried
> this, but it seems like it should work.

Your suggestion appears to provide flexibility but (perhaps I'm missing
something) still seems to lack the "live update" that would desirable when
resizing a window.  In any event, it's good to see some more thinking on
this.

I've spent a little time thinking about this as well (I developed the
original external spec that allowed SuperCard 3 to draw custom window
regions) and it seems to boil down to difficulty for the programmers
(Tuviah?) versus difficulty for the developers.  Referencing the points of a
polygon provides a fast way to numerically/dynamically modify an image, thus
scaling a window would be very doable, if not convenient.  On the other
hand, if it was indeed possible to reference multiple images as the mask
source, it would be phenomenally easily to build and maintain scalable
windows by virtue of moving the source images around on the card.  I'll be
the first to admit this is probably a way out there idea, but maybe Tuviah
has some tricks up his sleeve...

Regards,

Scott Rossi
Creative Director
Tactile Media, Multimedia & Design
-----
E: scott at tactilemedia.com
W: http://www.tactilemedia.com




More information about the use-livecode mailing list