3 Replies Latest reply on Sep 22, 2006 7:32 AM by Newsgroup_User

    How to let the sprites be magnified by proportion when maximize the window?

    WrongAgain
      If "maximizebox" in "Display Template" tab is set true, the window of the EXE file can be maximized. But the sprites remain the old dimension. It is not the custom that people use Windows program.
      How to let the sprites be magnified by proportion when the window is maximize?
        • 1. Re: How to let the sprites be magnified by proportion when   maximize   the window?
          Level 7
          1st off, let me say that it is more effort than it's worth to try to
          correctly scale the stage as you are asking. It is possible, but there
          are some serious issues. Most raster (bitmap) graphics do not scale
          well, text will get distorted, and quite a few other media types will be
          messed up. If you find that you have media that does not scale well,
          you'll need to write some custom code to deal with them. Basically, the
          commands which control the size of the stage are

          (the stage).rect
          (the stage).drawrect
          the desktopRectList

          Check them out in the help file for more specifics. Anyway, make a
          #movie script with the following code:

          global gOriginalStageRect

          on startMovie me

          --save this for when someone maximizes the screen later
          gOriginalStageRect=(the stage).drawrect

          end

          on zoomwindow --on maximize

          vLeft = ((the deskTopRectList[1][3]-(the stage).drawRect[3])/2.0).integer
          vTop = ((the deskTopRectList[1][4]-(the stage).drawRect[4])/2.0).integer
          (the stage).rect = the desktopRectList[1]
          (the stage).drawRect = rect(vLeft,vTop,vLeft+(the
          stage).drawRect[3],vTop+(the stage).drawRect[4])

          end

          on resizeWindow --on restore
          (the stage).drawrect=gOriginalStageRect
          end
          • 2. Re: How to let the sprites be magnified by proportion when maximize the window?
            WrongAgain Level 1
            Thanks!
            I modified your code in this way:

            (the stage).drawRect = rect(0,0,0+fScale*nOriWidth,0+fScale*nOriHeight)

            The value of fScale is calculate in some previous code. That will get result near to what I want. But there is a serious problem: Texts become rough and ugly after scaling. Is there any method to overcome it?
            • 3. Re: How to let the sprites be magnified by proportion when maximize the window?
              Level 7
              WrongAgain wrote:
              > Thanks!
              > I modified your code in this way:
              >
              > (the stage).drawRect =
              > rect(0,0,0+fScale*nOriWidth,0+fScale*nOriHeight)
              >
              > The value of fScale is calculate in some previous code. That will get
              > result near to what I want. But there is a serious problem: Texts
              > become rough and ugly after scaling.

              That's because it takes the image of the text and scales it, rather than
              increasing the font size of the text and scaling the rect of the sprite.

              > Is there any method to overcome it?

              Yes: do not change the drawRect. Instead, scale and reposition the
              individual sprites, and also increase the font size of members of text
              sprites.

              Or instead of having text sprites directly on the stage, you could have an
              non-antialiased text member at three or four times the size you need it and
              copy its .image to the required size bitmap member using copyPixels, which
              will antialias it for you, then show that bitmap on the stage.

              Andrew