display.newLine - rounded line ends?

Hi,

Does anyone know if it’s possible to make the ends of a line created with display.newLine rounded?

If I draw a line that is, say, 5 pixels thick then I’d like to round the ends - they currently look square and blocky which isn’t how I want them to look.

Thanks,

Ian

The only way is to add circles to the ends

Yes, circles. That’s the way I do it, although you don’t get anti-aliasing unless you use images.

Thanks for the quick reply.

Nice idea although I’m then applying an alpha of 0.5 to the line which means where the circles would overlap it would create a darker area. Can’t think of a way round that other than using masks on the circles perhaps… but that will get pretty fiddly in the context I’m using them in.

Cheers,

Ian

Not sure but try blend mode

Ok thanks will take a look. Appreciate the response.

Or try insert line and circles into a group then adjust alpha of group

I thought about that but assumed each object would still be treated independently. I’ll try it though.

Thanks.

Putting them in a group will still create darker areas where they overlap.

Just as a side-note: Graphics 2.0 will handle this situation with the new function display.newSnapshot().

Thanks ingemar - appreciate the info.

The only way is to add circles to the ends

Yes, circles. That’s the way I do it, although you don’t get anti-aliasing unless you use images.

Thanks for the quick reply.

Nice idea although I’m then applying an alpha of 0.5 to the line which means where the circles would overlap it would create a darker area. Can’t think of a way round that other than using masks on the circles perhaps… but that will get pretty fiddly in the context I’m using them in.

Cheers,

Ian

Not sure but try blend mode

Ok thanks will take a look. Appreciate the response.

Or try insert line and circles into a group then adjust alpha of group

I thought about that but assumed each object would still be treated independently. I’ll try it though.

Thanks.

Putting them in a group will still create darker areas where they overlap.

Just as a side-note: Graphics 2.0 will handle this situation with the new function display.newSnapshot().

Thanks ingemar - appreciate the info.