Howdy, Stranger!

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

Stars malformed

edited September 2012 in Bugs Posts: 116

I am on the iPad 3 with retina.

When using a strokeWidth of 1 or 2 I can't see the lines I draw

At 2.5 the lines look like a corner of a square

At 3 and above they are good.

I think the 2.5 looks neat but I'm not sure it is the desired look.

http://www.wrmichael.com/wp-content/uploads/2012/09/20120902-221545.jpg

-- stars
function setup()
    
    displayMode(FULLSCREEN)
    createstars()
    checkagain = false
end

function createstars()
    star = {}
    for i = 1,250 do 
        rx = math.random(1,1200)
        ry= math.random(1,800)
        u = { x=rx, y=ry}
      table.insert(star,u)
    end   
end

-- This function gets called once every frame
function draw()
    -- This sets a dark background color 
    background(0, 0, 0, 255)

    -- This sets the line thickness
    strokeWidth(2.5)
    
  --  line(lx,ly,CurrentTouch.x,CurrentTouch.y)
  --  lx = CurrentTouch.x
  --  ly = CurrentTouch.y

     for a,b in pairs(star) do
        stroke(math.random(1,255),math.random(1,255), math.random(1,255))
        line(b.x,b.y,b.x,b.y)
     end
    -- Do your drawing here
    
    --print(math.abs(ElapsedTime))
    if math.fmod(math.floor(ElapsedTime),2)==0 then
        if checkagain then
            createstars()
        end 
        checkagain = false
    else
        checkagain =true
    end
end


Comments

  • PTNPTN
    Posts: 39

    This may be due to the smoothing function. See if adding noSmooth() before drawing the lines helps

  • Nosmooth() caused the stars to not be drawn at all.....

    But I'll read up on the documentation and see if similar things exist.

Sign In or Register to comment.