It looks like you're new here. If you want to get involved, click one of these buttons!
Hi, the resolution of my image is 10 x 6, but output displays raw width/height.
Is there a way to actually define the resolution you want? If I define the image as 5 x 3, i can't use img:set on the pixels outside that range.
function setup()
spriteMode(CORNER)
noSmooth()
img=image(10,6)
setContext(img)
background(255, 255, 255, 255)
fill(0, 255, 0, 255)
ellipse(5,3,6)
setContext()
print(img)
end
function draw()
background(255, 0, 0, 255)
sprite(img,0,0,img.width*50,img.height*50)
end
Comments
On retina displays, you have half pixels. So the 1024 x 768 screen is actually 2048 x 1536. That's why an image of 10,6 reports a width and height of 10,6 but a raw width and height of 20, 12.
image.set is limited in the sense that on retina, it doesn't give you access to these half coordinates, effectively setting a 2x2 "block".
@yojimbo2000 @MMGames You can get to the half values, but they're actually whole number values. As mentioned above, a 10,6 image has raw values of 20,12. To get to the raw pixels, use rawGet(x,y). See the example below.
Oh wow, I never heard of
rawGet
. There's arawSet
too. They're not in the docs, so I guess someone should file a documentation update request ticket.@yojimbo2000 See this link, section Codea 1.3.5 Enhancements.
Thank you!!! (: