6 Replies Latest reply on Apr 26, 2007 4:04 AM by Newsgroup_User

    BuddyAPI

    newmfa Level 1
      Hi all,
      I use Buddy API Xtra with dirMX04 to switch my monitor to 800x600 fullscreen, but i hope someone tell me how start to do command for fullscreen..!

      regards
      newmfa
        • 1. Re: BuddyAPI
          newmfa Level 1

          Hi again,

          with Buddy API Xtra, i successed switch monitor resolution from 1280x1024 to 800x600 and 16bit depth to
          32bit depth by this code on first frame..

          on exitFrame me
          OK = baSetDisplayEx( 800 , 600 , 32 , 75 , "temp" , false )

          end

          how can i restore my previous settings when i exit director project?

          second problem, sometimes fullscreen not centered, i checked center option in display template, but
          the problem still live.

          i read in a topic that should us "(the stage).rect to (the desktopRectList)[1]"
          i put it after "OK = baSetDisplayEx( 800 , 600 , 32 , 75 , "temp" , false )"
          but i got error

          regards
          newmfa
          • 2. Re: BuddyAPI
            Level 7
            You can use baScreenInfo to get the width, height, and depth of the
            screen before you set it. Save those values as a global variable

            Then, on stopMovie, use baSetDisplayEx to change it back the way it was.
            • 3. Re: BuddyAPI
              newmfa Level 1

              i do that, but i got next error:

              script error: Variable used before assigned a value
              OK = baSetDisplay( gScrWdt , gScrHgt , gScrDepth , "perm" , false )
              i used 3 scripts:

              1-in first frame for save original settings in global variable

              on startMovie me
              gScrHgt = baScreenInfo( "height" )
              gScrWdt = baScreenInfo( "width" )
              gScrDepth = baScreenInfo( "depth" )
              gScrRefresh = baScreenInfo( "refresh" )
              end
              on stopmovie me
              OK = baSetDisplay( gScrWdt , gScrHgt , gScrDepth , "perm" , false )
              end

              2-script assign to a button to switch from window mode to fullscreen

              on mouseUp me
              OK = baSetDisplayEx( 800 , 600 , 32 , 75 , "temp" , false )
              (the stage).rect = (the desktopRectList)[1]
              end

              3-loop frame in the end of button frames

              on exitframe me
              go the frame
              end

              where is my wrong..?

              greetings
              newmfa
              • 4. Re: BuddyAPI
                Level 7
                Make sure that you declare your globals in every script window that uses
                them:

                global gScrWdt , gScrHgt , gScrDepth
                • 5. Re: BuddyAPI
                  newmfa Level 1

                  what you mean of " declare globals in every script window "
                  • 6. Re: BuddyAPI
                    Level 7
                    If you want a variable to be accessible to multipl scripts, then you
                    need to declare it as a global. Tiy do that by putting the word
                    "global" followed by the variable name(s) at the top of the script
                    window. Like this:


                    global gScrWdt , gScrHgt , gScrDepth

                    on startMovie me
                    gScrHgt = baScreenInfo( "height" )
                    gScrWdt = baScreenInfo( "width" )
                    gScrDepth = baScreenInfo( "depth" )
                    gScrRefresh = baScreenInfo( "refresh" )
                    end
                    on stopmovie me
                    OK = baSetDisplay( gScrWdt , gScrHgt , gScrDepth , "perm" , false )
                    end

                    Note that 1st line there. It is declaring the globals. With that line,
                    those variables become usable by both startMovie and stopMovie.