Dashed line

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
petero
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 59
Joined: Sat Jan 20, 2007 4:09 am

Dashed line

Post by petero » Fri Nov 23, 2007 11:51 pm

I have tried, unsuccessfully, to create a dashed line (arrow) in Revolution. I would like to eventually do this in a script but I can't even do it when in edit mode. I have checked the properties dashed lines box, I have tried transcript (setting the dashed lines property). Nothing seems to do it. I am creating in OSX.

Any suggestions would be appreciated.

Peter

malte
Posts: 1098
Joined: Thu Feb 23, 2006 8:34 pm
Contact:

Post by malte » Sat Nov 24, 2007 12:56 am

have you tried turning off antialiasing?

All the best,

Malte

Klaus
Posts: 14191
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Post by Klaus » Sat Nov 24, 2007 12:38 pm

Hi Peter-O,

From the docs for "dashes":
##...
Cross-platform note: On Mac OS and OS X, and Windows 95/98 systems, the dashes property cannot control the length of dashes and blanks: setting the dashes to any non-empty value at all creates a dashed line, but the length of dashes and blanks is controlled by the operating system.
##...

And yes, looks like this only works for not antialiased graphics at all.
Ergo: Hardly usable ;-)


Best

Klaus

Mag
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 802
Joined: Fri Nov 16, 2012 10:51 pm

Re: Dashed line

Post by Mag » Mon May 26, 2014 10:25 pm

And ... this is also true today? :roll:

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10317
Joined: Wed May 06, 2009 2:28 pm

Re: Dashed line

Post by dunbarx » Tue May 27, 2014 3:41 am

Peter.

The anti-aliased line looks awful.

It would not be hard to make your own, with a line graphic and a bunch of other opaque borderless objects all grouped together. I don't know how much you would need to manipulate this thing, though you could certainly could virtually make a new "object", with settable gap widths, etc.

Craig Newman

Klaus
Posts: 14191
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Dashed line

Post by Klaus » Tue May 27, 2014 1:37 pm

Hi Mag,
Mag wrote:And ... this is also true today? :roll:
why not make a quick test with a graphic yourself? 8)

It works with LC 6.6.1 and does not look awful when antialiased, see screenshot. :D
"dashes" are set to 30,20 in my example.


Best

Klaus
dashed_line_lc_661.jpg

Mag
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 802
Joined: Fri Nov 16, 2012 10:51 pm

Re: Dashed line

Post by Mag » Tue May 27, 2014 2:28 pm

Hi dunbarx and Klaus, thank you so much.

Klaus, where are the dashes property? I had not find it in the inspector... OK, I will search the Dictionary... :lol:

Klaus
Posts: 14191
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Dashed line

Post by Klaus » Tue May 27, 2014 2:38 pm

In the inspector right under the "linesize" field there is a checkbox to turn dashes on or off.
No interface to set the values unfortunately, you need to do this via script.

Mag
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 802
Joined: Fri Nov 16, 2012 10:51 pm

Re: Dashed line

Post by Mag » Tue May 27, 2014 3:01 pm

Klaus wrote:In the inspector right under the "linesize" field there is a checkbox to turn dashes on or off.
No interface to set the values unfortunately, you need to do this via script.
Thank you Klaus!

[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2262
Joined: Thu Feb 28, 2013 11:52 pm

Re: Dashed line

Post by [-hh] » Sat May 31, 2014 3:02 pm

..........
Last edited by [-hh] on Wed Aug 13, 2014 2:39 pm, edited 1 time in total.
shiftLock happens

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10317
Joined: Wed May 06, 2009 2:28 pm

Re: Dashed line

Post by dunbarx » Mon Jun 02, 2014 5:34 pm

Hemann.

You sort of used "marching ants" (I am thinking about the "j" in your switch construction) in your handler. Adorable.

Craig

[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2262
Joined: Thu Feb 28, 2013 11:52 pm

Re: Dashed line

Post by [-hh] » Mon Jun 02, 2014 10:26 pm

..........
Last edited by [-hh] on Wed Aug 13, 2014 2:38 pm, edited 1 time in total.
shiftLock happens

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10317
Joined: Wed May 06, 2009 2:28 pm

Re: Dashed line

Post by dunbarx » Tue Jun 03, 2014 2:53 pm

Hermann.

It does. All LC graphics have a "dash" property.

Place an arc below two lines oriented as you drew it. If anyone can make the dashes in that arc march, you can.

Craig

mrcoollion
Posts: 738
Joined: Thu Sep 11, 2014 1:49 pm

Re: Dashed line

Post by mrcoollion » Sat Dec 14, 2019 3:46 pm

Simple way to create a dashed line

1) Draw a line
2) put the following code into the script of the line you drew

Code: Select all

on mouseUp
   set the dashes of me to 10,2
end mouseUp
Put the IDE in run mode and click line.

based upon : https://livecode.fandom.com/wiki/Dashes

Regards,

Paul

Post Reply