5 Replies Latest reply on Oct 31, 2006 3:43 AM by duckets

    Im not a native

    makate Level 1
      can i use Director without being able to speak the lingo, it seems like even simple things need coding..
        • 1. Re: Im not a native
          duckets Level 1
          What kind of things are you trying to do?
          • 2. Re: Im not a native
            makate Level 1
            im tryin to create 3d rotating text
            • 3. Re: Im not a native
              duckets Level 1
              Ah rotating text :)
              Yes, it does need to be done with lingo, and there are a couple of snags you might hit which I'll list below.
              First, create a new behaviour (behaviour inspector, click the '+', give it a name, then open the script for it).

              Now, the simplest method that I can think of is this:

              --------------------------------------------------------
              property mem,textModel

              on beginsprite me
              mem = sprite(me.spritenum).member
              textModel = mem.model[1]
              end

              on enterFrame me
              textModel.rotate(0,4,0)
              end
              --------------------------------------------------------



              (if your movie isn't looping, you will also need to add 'go to the frame' into the script channel of the frame, to make the frame repeat its playback).

              However if you try the above behaviour script, you'll find the text rotates around the left edge of the sprite, coming in and out of view. You can rotate around the centre of the text by getting the text model's bounding sphere, creating a new node at the bounding sphere's centre position, and rotating around that instead. The modified behaviour script now looks like this:


              --------------------------------------------------------
              property mem,textModel,textCentre

              on beginsprite me
              mem = sprite(me.spritenum).member
              mem.resetWorld()
              textModel = mem.model[1]
              textCentre = mem.newGroup("textMiddle")
              textCentre.transform.position = textModel.boundingSphere[1]
              end

              on enterFrame me
              textModel.rotate(0,4,0,textCentre)
              end
              --------------------------------------------------------



              You now have the text rotating around its centre. We still have the values for the amount to rotate hard-coded into the behaviour though, not really best practice. We can make it so you can select the amount to rotate in the behaviour inspector panel by adding a propertyDescriptionList handler, and using properties to store the amounts to rotate in rx,ry and rz, like this:


              --------------------------------------------------------
              property mem,textModel,textCentre
              property rx,ry,rz

              on beginsprite me
              mem = sprite(me.spritenum).member
              mem.resetWorld()
              textModel = mem.model[1]
              textCentre = mem.newGroup("textMiddle")
              textCentre.transform.position = textModel.boundingSphere[1]
              end

              on enterFrame me
              textModel.rotate(rx,ry,rz,textCentre)
              end

              on getPropertyDescriptionList me
              pdl = [:]
              pdl[#rx] = [#comment:"X",#format:#float,#default:0.0]
              pdl[#ry] = [#comment:"Y",#format:#float,#default:0.0]
              pdl[#rz] = [#comment:"Z",#format:#float,#default:0.0]
              return pdl
              end
              --------------------------------------------------------




              - hope this helps!

              - Ben
              • 4. Re: Im not a native
                makate Level 1
                how do i learn this lingo, should i get a book or something. if so which book do you recommend. im in South Africa, so it must be universal.
                • 5. Re: Im not a native
                  duckets Level 1
                  I have always used search engine to search for director lingo tutorials, examples, and source code:

                  http://www.google.com/search?q=director+lingo+tutorial

                  http://www.google.com/search?q=director+lingo+example

                  http://www.google.com/search?q=director+lingo+source+code

                  Follow tutorials, experiment, practice and try things out. Also, the built-in help in director is a good place to start. Hit F1 in director, and start reading :-)

                  There are books on director lingo, but I haven't read any so I can't recommend them!

                  - Ben