User Tag List

Results 1 to 5 of 5

Thread: drawing a line

  1. #1
    No Products Registered

    Join Date
    Feb 2007
    Location
    USA
    Posts
    81
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    drawing a line

    I am attempting to draw a straight horizontal line. The length of the line depends on the value held by a counter. The line is contiguous throughout. That is - if the value is positive, the line will be extended horizontally to the right - if the value is negative the line would be drawn horizontally toward the left edge of the screen. the horizontal line length depending on the value generated, and the vertical lines being a constant value (say 15 pixels).

    Example: A positive value of 10 is generated - the line needs to be drawn 10 pixels toward the right edge of the screen. The line then drops down (becomes a vertical line) for say 15 pixels in preparation for the next value received. The next value is a -20, therefore the line needs to be drawn 20 pixels toward the left edge of the screen. It then drops down another 15 pixels, ready for the next value.

    Each turn, a value is generated, and the line is drawn either to the right(positive value) or to the left (neg).

    As always, you guys are the greatest, and your help is greatly appreciated.

  2. #2
    Forum Moderator Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Jun 2006
    Location
    England
    Posts
    3,546
    Mentioned
    4 Post(s)
    Tagged
    1 Thread(s)

    Re: drawing a line

    Multiple spaces get merged normally, you have to use the code tag:
    Code:
                         ---------------->
                                          |
                             <------------| 
                             |
                             |---------------------->
    I still don't know 100% what you want, but I expect you could generate it using a 1-pixel active object and the "paste into backdrop" facility. You make it paste multiple times at different positions using fast loops.
    .:::.Joshtek.:::.

  3. #3
    No Products Registered

    Join Date
    Feb 2007
    Location
    USA
    Posts
    81
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: drawing a line

    Boiling my lengthy question and example to a few words ... is there a way to draw a line from (for example) (100,50) to (200,50)?

  4. #4
    Forum Moderator Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Jun 2006
    Location
    England
    Posts
    3,546
    Mentioned
    4 Post(s)
    Tagged
    1 Thread(s)

    Re: drawing a line

    Yes.

    1. Create a 1-pixel object of the colour you desire
    2. Create three fast loops: right, left and down
    3. On fast loop right, increment X position by 1 and paste into background
    4. On fast loop left, decrement X position by 1 and paste into background
    5. On fast loop down, increment Y position by 1 and paste into background

    Then you can run the right loop value( "Counter" ) times if the counter is positive or run the left abs(value( "Counter" )) times if it is negative. To make it move down 15 pixels, make it run the down loop 15 times.
    .:::.Joshtek.:::.

  5. #5
    No Products Registered

    Join Date
    Feb 2007
    Location
    USA
    Posts
    81
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: drawing a line

    Thanks Joshtek - works perfectly!

Similar Threads

  1. Drawing a line between two points?
    By Outcast in forum Multimedia Fusion 2 - Technical Support
    Replies: 8
    Last Post: 26th December 2018, 07:42 AM
  2. Drawing a line from A to B
    By King_Cool in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 12th May 2010, 10:36 PM
  3. Line drawing
    By Sigvatr in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 28th April 2008, 01:50 PM
  4. Drawing line.
    By Roseweave in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 12th March 2008, 10:16 PM
  5. Drawing line between objects
    By Skeets in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 15th November 2007, 01:57 AM

Posting Permissions

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