{deck}
version:1
card:0
size:[512,342]
name:"GridPad"
author:"John Earnest"

{card:home}
image:"%%[encoded data, 22172 characters]"
script:"home.0"
{widgets}
preview:{"type":"canvas","size":[322,90],"pos":[93,127],"scale":1}
button1:{"type":"button","size":[56,52],"pos":[328,252],"script":"home.1","text":"New\nPage"}
type:{"type":"grid","size":[60,67],"pos":[129,238],"locked":1,"script":"home.2","scrollbar":0,"headers":1,"lines":0,"value":{"type":["isometric","square","triangle"]},"row":0}
size:{"type":"grid","size":[59,66],"pos":[196,238],"locked":1,"script":"home.2","scrollbar":0,"headers":1,"lines":0,"value":{"size":["large","medium","small"]},"row":2}
stroke:{"type":"grid","size":[62,66],"pos":[261,238],"locked":1,"script":"home.2","scrollbar":0,"headers":1,"lines":0,"value":{"stroke":["solid","dense","sparse"]},"row":1}

{script:home.0}
sizes.small:16
sizes.medium:24
sizes.large:48
b:100 # a big-ish number

types.square:on _ s do
 preview.pattern:(1,13,20)[stroke.row]
 x:0 while x<preview.lsize[0] preview.line[(x,0) (x,preview.lsize[1])] x:x+s end
 y:s while y<preview.lsize[1] preview.line[(0,y) (preview.lsize[0],y)] y:y+s end
end

types.isometric:on _ s do
 preview.pattern:(1,13,20)[stroke.row]
 y:s while
  y<preview.lsize[1] preview.line[(0,y) (preview.lsize[0],y)]
  y:y+s
 end
 preview.pattern:(1,18,12)[stroke.row]
 x:1 while x<2*preview.lsize[0]
  preview.line[(x,0) (x-2*s*b),(2*s*b)]
  x:x+2*s
 end
end

types.triangle:on _ s do
 types.isometric[s]
 x:-b*s while x<preview.lsize[0]
  preview.line[(x,0) (x+2*s*b),(2*s*b)]
  x:x+2*s
 end
end

on view do
 s:sizes[size.rowvalue.size]
 t:type.rowvalue.type
 preview.clear[]
 types[t][s]
 preview.pattern:1
end
{end}

{script:home.1}
on click do
 s:preview.size
 preview.size:card.size
 view[]
 i:preview.copy[]
 preview.size:s
 c:deck.add["card"]
 c.image:i
 go[c]
end
{end}

{script:home.2}
on click row do
 view[]
end
{end}

{card:card1}
image:"%%[encoded data, 23452 characters]"

