Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --color disiplay
- function setup()
- x11d = false
- x11l = false
- svgd = false
- svgl = false
- ct = {}
- cc = 0
- yt = 0
- f=HersheyRomanSimplex()
- watch("min")
- watch("max")
- watch("yt")
- end
- function draw()
- rect(0,0,10,10)
- background(0, 0, 0, 255)
- strokeWidth(6)
- if not x11d then
- f:drawstring("x11 loading ..", 150, 200)
- x11d = true
- elseif not x11l then
- for k,v in pairs(Colour.x11) do
- r = Colour.x11[k].colour.r
- g = Colour.x11[k].colour.g
- b = Colour.x11[k].colour.b
- lt = k .. " " .. r .. "," .. g .. "," .. b
- cc = cc + 1
- ct[cc] = {r=r,g=g,b=b,lt=lt}
- end
- x11l = true
- elseif not svgd then
- f:drawstring("svg loading ..", 150, 200)
- svgd = true
- elseif not svgl then
- for k,v in pairs(Colour.svg) do
- r = Colour.svg[k].colour.r
- g = Colour.svg[k].colour.g
- b = Colour.svg[k].colour.b
- lt = k .. " " .. r .. "," .. g .. "," .. b
- cc = cc + 1
- ct[cc] = {r=r,g=g,b=b,lt=lt}
- end
- svgl = true
- else
- min = math.floor(yt / 45)
- max = math.floor((yt+HEIGHT)/45)
- if min < 1 then min = 1 end
- if min > cc then min = cc end
- if max > cc then max = cc end
- if max < 1 then max = 1 end
- for i = min, max do
- stroke(ct[i].r,ct[i].g,ct[i].b)
- f:drawstring(ct[i].lt, 10, (i * 45)-yt,1.5)
- end
- end
- end
- function touched(touch)
- --translate(0, yt)
- yt = yt + touch.prevY - touch.y
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement