Skip to content

Instantly share code, notes, and snippets.

@bortels
Created November 1, 2011 04:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save bortels/1329881 to your computer and use it in GitHub Desktop.
Save bortels/1329881 to your computer and use it in GitHub Desktop.
-- Use this function to perform your initial setup
function setup()
fontinfo={}
fontinfo["#"] = { points=11, width=21, ascii=35,
data={ 11,25,4,-7,-1,-1,17,25,10,-7,-1,-1,4,12,18,12,-1,-1,3,6,17,6 } }
end
-- This function gets called once every frame
function draw()
background(111, 157, 106, 255)
-- fill(255,0,0)
fill(0, 0, 0, 50)
--rect(0,0,WIDTH,HEIGHT)
stroke(223, 255, 0, 255)
strokeWidth(3)
--drawchar("#", 10, 10)
--line(10,10,300,300)
hardcoded()
end
function hardcoded()
line(11,25,4,-7)
line(17,25,10,-7)
line(4,12,18,12)
line(3,6,17,6)
end
function drawchar(c, ox, oy)
ax=-1
ay=-1
bx=-1
by=-1
fi=fontinfo
ch = fi[c]
for p=1, ch.points do
ax=bx
ay=by
bx=ch.data[p*2-1]
by=ch.data[p*2]
draw=1
if ((ax==-1) and (ay==-1)) then draw=0 end
if ((bx==-1) and (by==-1)) then draw=0 end
if (draw>0) then
print(ox+ax, oy+ay, ox+bx, oy+by)
line(ox+ax, oy+ay, ox+bx, oy+by)
end
end
end
@simsaens
Copy link

simsaens commented Nov 1, 2011

Fixed this in a fork here: https://gist.github.com/1330041

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment