0 Replies Latest reply on Oct 9, 2009 11:43 AM by RNeilen216

    problem with scaling the stage

    RNeilen216

      Hi there all,

      I have this little problem. I am trying to build a game, just for fun purposes, where I realized that everything could not fit onto 1024x768 stage. So I thought I could just make the stage a little bigger when I am designing it, and then the final test would be to scale the stage down that would fit approximatly into an aspect ratio of 1024x768. From experience, I know you would use the drawRect of the stage to scale the stage, but I am having a little problem with it. Firstly, before I continue, I am still using Director 8.5; yes I know it is really old. However, I cannot afford another new ver version.

       

      On to my problem... Since I would like to have my main movie script find out the original movie size dynamically as oppose to hardcoding the settings I have entered in the properties dialog box, my theory was to get the width and height of the sourceRect, but when I am in Director, the sourceRect values are the original values from when I first created the new movie as oppose to the new movie size I have set in the movie properties dialog window. So for example, let's say I create a new movie, and by default, it is set to 640x480, but then when I go to change this in the movie properties dialog box to say 1280x1024, the sourceRect values are still the same values of 640x480.  This is a problem since I am trying to have the movie script find the size of the stage dynamically.  Here is my code

       

       

      on startMovie

        mWidth = (the stage).sourceRect.width

        mHeight = (the stage).sourceRect.height

       

        -- Get the aspect ratio percentage

        percentAspect = 768.0000 / mHeight

        newWidth = mWidth * percentAspect

        newHeight = mHeight * percentAspect

       

        (the stage).drawRect = rect(0, 0, newWidth, newHeight)

      end

       

      on stopMovie

        (theStage).drawRect = (theStage).sourceRect

      end

       

      Do you have any ideas how I can fix this or get around this?