Professional Web Applications Themes

draw a line - Macromedia Director Lingo

i want to draw a line by lingo. I'm using the draw() function and it isn't working. It says that is missing three parameters but i don't know which parameters is he asking for. member("line").image.draw(214, 154, 354, 289, [#shapeType:#line, #lineSize:3, #color: rgb(150, 0, 0)]) this is the code line i'm using. I don't know if i have to create preaviously the cast member "line" and put it to in the timeline and what kind of member i need or if it is created by lingo...

  1. #1

    Default draw a line

    i want to draw a line by lingo. I'm using the draw() function and it isn't working. It says that is missing three parameters but i don't know which parameters is he asking for.

    member("line").image.draw(214, 154, 354, 289, [#shapeType:#line, #lineSize:3, #color: rgb(150, 0, 0)])

    this is the code line i'm using.

    I don't know if i have to create preaviously the cast member "line" and put it to in the timeline and what kind of member i need or if it is created by lingo



    dbento Guest

  2. #2

    Default Re: draw a line

    Nothing seems to be wrong with the statement as written, however you need to
    be sure that the member exists in the internal cast library. You can try
    using points instead of direct xy coords
    e.g.
    member("line").image.draw(point(x1,y1), point(x2,y2).......

    You can also try the following

    Add a bitmap member to a sprite channel on the score
    or create in Lingo using
    myMember = new(#bitmap, member (x) of castlib <which castlib>) -- x needs to
    be a number
    myMember.name = "line"

    -- you can draw to the member using
    myImage = Image(X dimension, Y Dimension, colordepth) -- creates a new image
    object
    myImage.draw(214, 154, 354, 289, [#shapeType:#line, #lineSize:3, #color:
    rgb(150, 0, 0)]) -- draw to your new image
    member("line").image = myImage -- assign image to your cast member

    or if drawing on top of a previous image

    change the first line to
    myImage = duplicate(member("line").image) -- which gets a copy of the image
    for work,

    hope this helps

    Stephen Whipp
    Eastmond Publishing Ltd (UK)


    dbento <com> wrote in message
    news:bvr6jg$klf$macromedia.com... 
    working. It says that is missing three parameters but i don't know which
    parameters is he asking for. 
    #lineSize:3, #color: rgb(150, 0, 0)]) 
    put it to in the timeline and what kind of member i need or if it is created
    by lingo 


    Stephen Guest

  3. #3

    Default Re: draw a line

    Imaging lingo functions like the draw command are a bit more advanced,
    if you just want a simple line to appear on stage there are 2 simpler
    alternatives.


    1) change the rect of asprite assigned a tool palette line object,
    there's a property (I can't name) used to control whick corners the line
    intersects.

    2) change the vertexList of a vector member placed on stage, actually
    you can just change the rect of the sprite using the vector member, but
    changing the member vertexList might give better control, to get the
    syntax examine the vertexList of a verctor member containing a single
    line.
    JB Guest

  4. #4

    Default Re: draw a line

    Your code works fine if you actually have a bitmap cast member named "line"

    You can create an image through lingo, but your line of code won't do it
    automatically.

    p = image(640,480,32)
    p.fill(p.rect, rgb(120,120,120))
    m = member(new(#bitmap))
    m.image = p
    m.image.draw(214, 154, 354, 289, [#shapeType:#line, #lineSize:3, #color:
    rgb(150, 0, 0)])

    or

    m.name = "line"
    member("line").image.draw(214, 154, 354, 289, [#shapeType:#line,
    #lineSize:3, #color: rgb(150, 0, 0)])

    --


    Dave
    http://www.blurredistinction.com/director


    Dave Guest

Similar Threads

  1. draw line on top of bitmap
    By finecur in forum Macromedia Flex General Discussion
    Replies: 4
    Last Post: May 23rd, 05:21 AM
  2. Draw line using Acrobat SDK
    By Madhav@adobeforums.com in forum Adobe Acrobat SDK
    Replies: 18
    Last Post: November 25th, 12:26 PM
  3. draw line as a Component
    By ST in forum Macromedia Flex General Discussion
    Replies: 0
    Last Post: March 12th, 06:41 AM
  4. 3D Draw Line?
    By connoru in forum Macromedia Director 3D
    Replies: 3
    Last Post: August 4th, 03:27 PM
  5. draw a line
    By hondo3000 webforumsuser@macromedia.com in forum Macromedia Director 3D
    Replies: 2
    Last Post: January 20th, 02:28 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139