I did a quick search on the forums. Correctly me if I am wrong, but Codea supports PDFs but not SVG right?
I am looking to be able to scale graphics without losing resolution like SVG images do.
Are PDFs just vector graphics in disguise? Or should I just stick with PNGs and just make them over sized so when they grow/shrink I don’t lose resolution?
What is the best way you have found to scale graphics and keep them looking nice?
Thanks as always! I love this community.
@MrScience101 PDFs are vector graphics, even just the text in a PDF document is so you can scale that to any size.
Here’s an experiment, turns out your probably better off using raster graphics.
n = 0
n = n + 0.6
Here’s the image
My understanding is that when Codea reads in a PDF then it rasterises it to the specified width. So at read time then you have free choice, but after that it is fixed. You could always re-read it in when the size gets too far from the original choice (I’ve seen many systems that do a low-resolution initial zoom and then a repass at the higher resolution once the user has decided on the zoom).
@Andrew_Stacey good point I will have a look at that
Brilliant! Thank you both so very much!
In StackIt, everything is a vector graphic. However, I’m the setup, I rasterize everything. That way I some have to worry about resolution errors or anything.
@Luatee As @Andrew_Stacey says, Codea rasterizes it when you draw it. If you want to render a large vector image, it’s intended that you use something like:
img = readImage("Documents:Vector Image", size)
sprite(img, WIDTH / 2, HEIGHT / 2)
(Pseudo-code, but you get the point. Rasterize it once, no lag.)
@SkyTheCoder I understand that no worries, I was demonstrating to MrScience101 that is it possible to render a 50x50 pixel pdf at any size using that code above.