Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

What's up with lines?

edited July 2013 in Questions Posts: 90

I haven't used Codea in 1 1/2 years so maybe my memory is fuzzy, but lines seem "thick". I ran an old user-provided program, and one of my own, and the lines seem thicker than they used to be, in the user program making the screen far busier-looking than I remember, and in my program smearing a bunch of hash marks together.

I tried drawing 2 horizontal lines 5 pixels apart, yet the gap between them wasn't 4 pixels but appeared to be 1 pixel. Is there now a command to control the thickness of a line?

Comments

  • Posts: 90

    I'll answer my own question. I think the default thickness has changed. strokeWidth() can change it, except that it appears only even numbers have an effect, i.e. strokeWidth(2) == strokeWidth(3). Also, with strokeWidth(1), horiz lines don't appear but 45* lines do. I didn't check this with other diag lines or with other widths.

  • dave1707dave1707 Mod
    Posts: 7,520

    You're correct about the even/odd value strokeWidths. I couldn't tell the different
    between a strokeWidth with 2 and 3 or 3 and 4. Of course I'm using an iPad 1, so I don't know if a difference can be seen on the newer displays.

  • Posts: 391

    On the ipad4, there is definitely a difference between all the values of strokeWidth.

  • Posts: 90

    I'm using an iPad 2. That probably explains it--the default thickness has been modified for Retina displays. Specifying "noSmooth" also helps (see comments in Codea's "lines" example program--they change smoothness based on a line's width); then you can say strokeWidth(1) and both horizontals, verticals, and 45* diagonals come out just fine.

Sign In or Register to comment.