| ||||
|
Lingo Programming : Director Online Forums
Questions about Lingo programming at all Levels
Centered and FullScreen at runtime
Posted by: Todd (---.lax.megapath.net)
Date: April 26, 2007 01:18AM Is there a way to change resolutions of a projector and make the stage snap back to the center position without having to restart the projector?
Im trying to essentially create one projector that has say 3 sections for 3 different resolutions. Id like to hit a key to jump to the proper section for the resolution and have the movie play centered but its not. When i change the resolution during runtime and and then jump to the appropriate section in my projector file the movie plays off center even though im publishing the movie with lock to stage and centered and all graphics are centered. What am I missing? Id like to think i can do this in one file and not make 3 separate files or have to restart the projector everytime i change a resolution during runtime. Anyone? thxs Re: Centered and FullScreen at runtime
Posted by: Sean Wilson (---.paradise.net.nz)
Date: April 26, 2007 01:32AM Once you've changed your resolution, use:
_player.activeWindow.rect = mCenterRectInRect(_system.deskTopRectList[1], _player.activeWindow.rect) -- #movie script: on mCenterRectInRect r1, r2 dx = (r1.width - r2.width )/2 dy = (r1.height - r2.height)/2 return r2.offset(dx, dy) end Re: Centered and FullScreen at runtime
Posted by: Todd (---.lax.megapath.net)
Date: April 26, 2007 02:37AM There is hope, this looks like it is possible to get this to work; but its not quite working right for me.
Im not sure how to explain what its doing. It took me a bit of time to figure out whats going on. Basically its offsetting the stage -128,-128 each jump to a new resolution area of my graphic. I think this is happening when the return r2.offset(dx,dy) is set. Im trying to get up to speed on the coding but im still strugglin. This code barely makes sense to me but on a reach, I think I know what your trying to do. I tried to look up some of the code but I couldnt find the exact reference. As a result im a bit lost on how to fix it. Can you point me to where I can read up on what youre doing? Id like to understand it a bit more. Here is what is in my frame script...maybe i got things in the wrong place. on exitFrame me go the frame end on keydown case the key of "m": go to "menu" "9": cursor 200 "0": cursor 0 "b": go to "black" "1": go to "1024" _player.activeWindow.rect = mCenterRectInRect(_system.deskTopRectList[1], _player.activeWindow.rect) "2": go to "1280" _player.activeWindow.rect = mCenterRectInRect(_system.deskTopRectList[1], _player.activeWindow.rect) end case end -- #movie script: on mCenterRectInRect r1, r2 dx = (r1.width - r2.width )/2 dy = (r1.height - r2.height)/2 return r2.offset(dx, dy) end Re: Centered and FullScreen at runtime
Posted by: Sean Wilson (---.paradise.net.nz)
Date: April 26, 2007 03:02AM What I posted as a #movie script I had intended to be placed in a script of that type (hit Ctrl + Shift + U and copy+paste the handler in the script window that opens).
It's not clear from the code you posted where, when and how you change resolutions. Re: Centered and FullScreen at runtime
Posted by: Todd (---.lax.megapath.net)
Date: April 26, 2007 07:56AM I change resolutions independent of the dir projector playing.
Im on a mac and would be "Apple + Tab" to get to the finder and then changing resolutions and then Apple tab back to the projector. (Alt+tab on windows) Once this is done and I return to the projector, its off center to the lower right. Here is how I setup my dir project: What I have setup is a dir movie set at a stage size of 1280 x 1024. (My largest resolution) At frame 10-19 I have my 1280 graphics centered on the stage. A frame marker is set at frame 10 to jump to the first graphic of this section. I move thru this section by pressing two keys that take me to next or previous graphic. At frame 20-29 I have another frame marker labled 1024 and the 1024 graphics for this section are centered on the stage and navigate forward and back as did as explained above. Because the 1024 graphics are smaller, I see a frame of the background stage arround the graphics. This is fine as when Im at the 1024 size you wouldnt see this as each border or exposed section of the stage would be outside the visible frame of the monitor when in 1024. My problem is that when resolutions are changed on the monitor while the projector is playing, its not centering the projector file back to the "screens" center so its showing offcenter. Re: Centered and FullScreen at runtime
Posted by: Sean Wilson (---.paradise.net.nz)
Date: April 26, 2007 02:09PM So your stage is always 1280 x 1024 but you have different sections that you send the user to depending on a key press (or ...) and these sections have sprites laid out around the center of the stage, but you are needing to manipulate the rect of the stage so that its center is always at the center of the monitor. Is that about right?
Further, the problem only appears when you've tabbed away from and then back to your projector - is that correct? How is it that you are changing resolution when tabbing to/from your projector - there must be an xtra involved here. Re: Centered and FullScreen at runtime
Posted by: Todd (---.lax.megapath.net)
Date: April 26, 2007 11:53PM Yes thats correct. Wish I could have said it in such few words.
stage is always 1280 x 1024 and the different sections hold the different graphics centered arround the center location of a 1280 x 1024 stage. To get the resolution to change, im doing it without an xtra as I dont have one to do it with and for this project, it doesnt warrant purchasing one for what im creating. I change the resolution by Command Tab (mac) or Alt + Tab to get the respective OS' to switch me to the finder. Once here i manaually change the screen resolution then bounce back into the projected director file. If there is a way to change resolutions from within director without a 3rd party xtra then that would be super slick. As for the problem only appearing when I tab away from and then back to the projector, yes. If I dont leave the projector to change resolutions, its fine. Once i command or alt tab out and come back, its a shrinky dink. Is this code storing the values of the stage or the graphic? If so, would i need to clear them to get it to work? I guess im not familiar with the lingo code and what the parameters mean and so far Ive yet to find it in the Lingo dict...but im still lookin. appreciate the assistance. T Re: Centered and FullScreen at runtime
Posted by: Sean Wilson (---.paradise.net.nz)
Date: April 27, 2007 12:39AM Correct me if I'm wrong, but what you need to do is detect when the application gains focus again and run the centering routine at that point.
If so, you could try the following 2 handlers in a #movie script: -- on activateApplication _player.activeWindow.rect = mCenterRectInRect(_system.deskTopRectList[1], _player.activeWindow.rect) end on mCenterRectInRect r1, r2 dx = (r1.width - r2.width )/2 dy = (r1.height - r2.height)/2 return r2.offset(dx, dy) end I guess I don't understand why you don't use an xtra like Buddy API to switch resolution for you (and why you have an apparent objection to 3rd party xtras), or why you're tabbing to the Finder, altering resolution and tabbing back to your projector... Re: Centered and FullScreen at runtime
Posted by: Todd (---.lax.megapath.net)
Date: April 27, 2007 02:45AM I know it sounds a bit odd.
What im doing is building a computer test signal generator. It will generate various charts that I have made for taking readings. I work in the film industry and set exposure and color balance readings for monitors on film sets. I spend alot of time in the monitor setup where resolution, aspect ratio, V&H freq affect how a monitor photographs. The nature of how I work with monitors puts me into the monitor settings anyways. Having the projector do this for me isnt as much of an issue as my charts not being centered properly; especially if im looking at a sizing chart. This director file is only to send these test charts to the monitors so that I can take meter readings from them. Once this is set, then Im done with this file and will be sending a different signal to the monitor on the set. I will try a few of the things you have suggested as well as look at the xtra. Re: Centered and FullScreen at runtime
Posted by: Todd (---.lax.megapath.net)
Date: April 27, 2007 02:48AM Can you recommend any good books to help me understand the lingo commands. Often I find myself reading the lingo commands but Im having a hard time understanding how they really function or work. Ive looked for books with examples but have yet to find anything worth picking up.
tia Todd Re: Centered and FullScreen at runtime
Posted by: Aldus (---.dip.t-dialin.net)
Date: April 27, 2007 08:06AM One famose e-book comes from Irv Kalb: LOOPE
[www.furrypants.com] Warren Okrassas "A beginner guide" [www.nightwares.com] and of course the books of Gary Rosenzweig here ... Also take a look for the "Lingo-Database" here. hih Aldus ------------- ![]() Sorry, only registered users may post in this forum.
|