Place a movie script with this in the movie...
on resizeWIndow sendAllSprites(#windowResized) end
Then add this on the components. For most apps you scale from the top left down so this should cover anything that is not anchored to the right or bottom. For that this can easily be expanded though to account for other directions and anchor points. Also, there is some custom code in here, like taking 16 pixels off text members to account for the scrollbar, etc. Not optimized for the general public. ;)
property spriteNum property pAnchor property pRect property pOffsetRect property pMember
on beginSprite me pMember = sprite(spriteNum).member pRect = sprite(spriteNum).rect a = (the activeWindow).rect a = a.offset(-a.left, -a.top)
pOffsetRect = a - pRect put pREct && pOffsetRect
--- me.windowResized() end
on windowResized me
r = pRect
a = (the activeWindow).rect
a = a.offset(-a.left, -a.top)
case pAnchor of
#topleft :
r = rect(pRect.left, pRect.top, a.right - pOffsetRect.right, a.bottom - pOffsetRect.bottom)
#top :
--only scale down
r = rect(pRect.left, pRect.top, pRect.right, a.bottom - pOffsetRect.bottom)
put spriteNum && "top" && (the activeWindow).rect.height && r.height
#left :
--only scale right
r = rect(pRect.left, pRect.top, a.right - pOffsetRect.right, pRect.bottom)
end case
if pMember.type = #text then
pMember.rect = r
pMember.width = r.width - 16
pMember.height = r.height
end if
sprite(spriteNum).rect = r sendSprite(spriteNum, #updateTile, r) end
on getPropertyDescriptionList me
p = [:]
p[#pAnchor] = [#format : #symbol, #comment : "What anchor point?", #default : #topLeft, #range : [#topLeft, #left, #top]]
return p
end
-Chuck -------------------------- Chuck Neal CEO, MediaMacros, Inc. [EMAIL PROTECTED] http://www.mediamacros.com -------------------------- Check out the Developers Mall Your one stop shop for all your Director Xtra Needs http://www.mediamacros.net/customer
Jon Alongi wrote:
[To remove yourself from this list, or to change to digest mode, go to http://www.penworks.com/lingo-l.cgi To post messages to the list, email [EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED]). Lingo-L is for learning and helping with programming Lingo. Thanks!]Hi Chuck, do you have an example dir that I could see please. It would much appreciated
Regards Jon
On 15/12/04 2:33 pm, "Chuck Neal" <[EMAIL PROTECTED]> wrote:
You need lingo to do that and the trick is how each element scales.
I have done this before by making behaviors that scale items with a lock point. For example, a background stretches to full screen. A test item might keep its top and left coordinate, but scale to the right only. You have to define how the items change, but you can trigger them on move and resize events.
-Chuck -------------------------- Chuck Neal CEO, MediaMacros, Inc. [EMAIL PROTECTED] http://www.mediamacros.com -------------------------- Check out the Developers Mall Your one stop shop for all your Director Xtra Needs http://www.mediamacros.net/customer
Jon Alongi wrote:
Hi there many thanks for the tip. However I tried it and its not really what I meant.
As far as I can tell it only resizes the miaw when it starts.
What I actually want to do is: Be able to DRAG the corner othe miaw to make it variable sizes. When I do that I want everything to scale with it.
Regards Jon
On 15/12/04 11:56 am, "KLGC Studio" <[EMAIL PROTECTED]> wrote:
Jon,
See http://www.killingmoon.com/director/klgcstudio/ and look at auto_size.ls
Lee C
Jon Alongi wrote:
Hi there, ive been meaning to ask you guys for adivce on this for a while.
Is it possible in Director, using Miaws to create a resizable MIAW which will automaticly scale the content of the window.
Most normal programs do this, but im not sure how you would pull this off in Director.
Which one of you genius's can help?
Many thanks
Jon
[To remove yourself from this list, or to change to digest mode, go to http://www.penworks.com/lingo-l.cgi To post messages to the list, email [EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED]). Lingo-L is for learning and helping with programming Lingo. Thanks!]
[To remove yourself from this list, or to change to digest mode, go to http://www.penworks.com/lingo-l.cgi To post messages to the list, email [EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED]). Lingo-L is for learning and helping with programming Lingo. Thanks!]
[To remove yourself from this list, or to change to digest mode, go to http://www.penworks.com/lingo-l.cgi To post messages to the list, email [EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED]). Lingo-L is for learning and helping with programming Lingo. Thanks!]
[To remove yourself from this list, or to change to digest mode, go to http://www.penworks.com/lingo-l.cgi To post messages to the list, email [EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED]). Lingo-L is for learning and helping with programming Lingo. Thanks!]
[To remove yourself from this list, or to change to digest mode, go to http://www.penworks.com/lingo-l.cgi To post messages to the list, email [EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED]). Lingo-L is for learning and helping with programming Lingo. Thanks!]