Updated original post to actually contain link to repo at github (duh).
Also, in talking to Geoff the other night, we came up with an idea for another component, rdCSS. The idea is, you could define "classes" (in the CSS sense) and assign roImageCanvas attributes to them, to be used later to auto-set roImageCanvas attributes as specified.
e.g.
function cssDefs() as object
return {
commonImage: {
url: "http://some.common.image/path.jpg"
}
large: {
targetRect: { w: 500, h: 500 }
}
small: {
targetRect: { w: 200, h: 200 }
}
red: {
color: "#FF0000"
}
left: {
targetTranslation: { x:100 }
}
right: {
targetTranslation: { x:800 }
}
top: {
targetTranslation: { y:100 }
}
bottom: {
targetTranslation: { y:500 }
}
}
end function
It will merge any class names together to make the roImageCanvas object, as well as any params supplied as an optional third argument. Right most class names would take precedence (overwriting duplicate values), and of course anything specified manually would override any classes.
canvas.addLayer(1, rdCSS(["top","left", "large", "commonimage"]))
canvas.addLayer(2, rdCSS(["top","left","small"], { url: "http://some.url/path.jpg" }))
canvas.addLayer(2, rdCSS(["bottom","right"], { url: "http://some.url/otherpath.png" }))
Make sense? Anyone have any interest, see any problems, want to offer suggestions?
-- GandK Labs
Check out Reversi! in the channel store!