7 Replies Latest reply on Jul 2, 2008 5:34 AM by duckets

    Scale property for sprites

    Sharkmenace Level 1
      Can someone tell me if there is a scale property like _xscale or _yscale in Flash for sprites. I want to upgrade but it doesn't seem like adobe intends to put any developers on Director. I read a post about there being no undo history (multiple undos). Can someone please tell me what's up?
        • 1. Re: Scale property for sprites
          Level 7
          There is no scale property as such- at least it is not named 'scale'.
          But there are properties like width and height which pretty much amount
          to the same thing. If you want to scale the sprite to double its size
          on the x axis, you would set it width * 2.

          There is also the rect property which defines the bounding rectangle's
          coordinates which can be used to scale sprites quite easily.

          There is also a skew property to warp the bounding box. And a quad
          property to control the corner points of the rect. You can do pretty
          much all the transformations you want. Then, if you find something that
          you can not do, you can probably do it in a different way, like using
          imaging lingo which is super powerful for editing images at runtime.

          If you are going to try to use Director as you use Flash, then you will
          probably not like it. It is not Flash, and it is not meant to do the
          things that Flash is meant to do.

          But, if you take the time to learn how to use Director as it is meant to
          be used, it is supremely powerful and actually pretty easy to use. Yes,
          there is a learning curve. But it is well worth it.

          It is true that you have only one level of undo. This is a bone of
          contention amongst developers. My personal thoughts on the subject are
          "who cares". Seriously. There are more important things to worry
          about. A well implemented single undo system (which is what we have) by
          far beats out a poorly done multiple undo system. I remember a while
          back when I used to use Flash a little (it was a long time ago so things
          may have improved since then), they had multiple undos, and it was
          terrible. You never quite knew what you were undoing if you made a
          change then edit a symbol, then make another change then go back to the
          main timeline, then make another change. You would undo three times,
          thinking that it would undo the last 3 things you did, but it would not
          actually undo anything out of the scope of the current screen. 3D
          Studio MAX is the same way (current version). If you do things in
          different screens, you never really know what is going to be undone, and
          it has caused more grief than I can explain. Especially if redo works
          differently.

          If you are careful when you work, and save multiple backups of
          everything you work on, then there is really no reason to need multiple
          undos... but that's just me. I'd rather see the Director team working
          on improving the text engine or better media support (AS3?).
          • 2. Re: Scale property for sprites
            Sharkmenace Level 1
            Thanks, Mike.

            I'm feeling a bit depressed now. In MX I had to do some tricketty-trick with the width and height property to simulate scaling because they were assigned by reference.

            <sigh>
            • 3. Re: Scale property for sprites
              Production Monkey Level 3
              Sharkmenace ,

              by scaling, to you mean something like this:

              on exitframe me
              sprite(me.spriteNum).rect = sprite(me.spriteNum).rect.inflate(2,2)
              end exitframe

              Mike,

              I completely agree with your thoughts on multiple undos. There are far more important features and problems that need to be addressed first.
              • 4. Re: Scale property for sprites
                bruce34567

                lol i don't trust something trying to undo anything in director past 1 level. There is a lot of things code can do!!!!

                What ever happened to the good old days of pen and ink when there was no undo and you had to focus and be exact!
                • 5. Re: Scale property for sprites
                  duckets Level 1
                  Re: scaling sprites,

                  Remember that sprites are separate concepts to cast members. The chances are that if you're thinking "I want to scale a sprite", your really want to set its width and height to a size which is in proportion to the sprite's cast member's size.

                  eg, to scale to 120%

                  my = sprite(me.spritenum)
                  my.width = my.member.width * 1.20
                  my.height = my.member.height * 1.20

                  hope this helps clarify things,

                  - Ben
                  • 6. Scale property for sprites
                    Sharkmenace Level 1
                    Does anyone read the posts?
                    And what's all this talk about undos being a bad thing.
                    HELLO! We are engineers. We solve problems. We find ways to make things easier and compensate for human error so that we have more time to do other things: like spend time with the family or the dog.

                    I can't believe what I'm reading.
                    Are you guys one of the lazy programmers working for adobe?
                    The lazy programmers who are too incompetent to reverse engineer legacy code to get to the bottom of a longstanding problem?
                    Lazy programmers who have no respect (or knowledge) of the days when we had to hand code assembly opcode?

                    Gimme a break!
                    A $1200 software product without multiple undos is a disgrace and a slap in the face to every real programmer who ever walked the face of the earth.

                    quote:

                    Originally posted by: duckets
                    Re: scaling sprites,

                    Remember that sprites are separate concepts to cast members. The chances are that if you're thinking "I want to scale a sprite", your really want to set its width and height to a size which is in proportion to the sprite's cast member's size.

                    eg, to scale to 120%

                    my = sprite(me.spritenum)
                    my.width = my.member.width * 1.20
                    my.height = my.member.height * 1.20

                    hope this helps clarify things,

                    - Ben


                    • 7. Scale property for sprites
                      duckets Level 1
                      quote:

                      Originally posted by: Sharkmenace
                      And what's all this talk about undos being a bad thing.


                      I don't think the view is generally that multiple undos would be a bad thing in director, but it certainly would be very difficult to implement, and therefore perhaps the time spent by the Director engineers on this feature might be better spent implementing other features.


                      To illustrate why it's a significantly more complex task in Director, consider the following.

                      You create a script cast member. You write a few lines of code into that script member which, when run, creates a new bitmap cast member, and performs a draw operation to the image of that cast member. You run the movie.

                      Now, what should be in the undo stack? The last modification to the movie was the draw operation, and the last cast member created was the bitmap cast member. But the last actions you as a user personally performed was to write some script, and press play. Should every single lingo operation that modifies the movie go onto the undo stack? What if I wrote a repeat loop to draw a pixel starfield image directly on an image member. Should each of the 1000 setpixel operations go onto the undo stack? And if we don't add these kind of changes on to the call stack, then what do we do instead... just erase the undo history?

                      (EDIT: just tested, and that is what Director currently does - it clears the single 'undo' if lingo modifies the movie)

                      The flexibility of lingo to modify pretty much any aspect of the movie means that the considerations of implementing an undo are extremely complex. I'm all for multiple undos, if anyone can propose a sensible way of implementing them!


                      - Ben