Corona:显示可缩放矢量文件(如 .pdf)
是否可以在 Corona 中显示可缩放的矢量文件?
具体来说:我想在我正在构建的应用程序中显示地图,并且我希望它是矢量而不是图像,以便分辨率在用户放大或缩小时保持不变。
如果有人有其他方法来获得这个结果,我也对此感兴趣。
Is it possible to display a zoomable vector file in Corona?
Specifically: I'd like to display a map in an app I am building, and I'd like it to be a vector rather than an image so that the resolution remains the same as the user zooms in or out.
If anyone has an alternate method to get this result I'm interested in that too.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
CoronaSDK 没有内置“矢量格式加载器”,但能够绘制直线、多边形、圆形等 - 您可以在此处获取更多信息:
http://developer.anscamobile.com/reference/factory-functions
考虑到这一点,您可以创建自己的自定义格式(可能是 Lua 格式):诸如“画一个从这里到这里的直线”或“这个位置有一个这个大小的圆”。
对于放大/缩小,您只需为所有图形对象添加一个“父级”,将其称为“地图”,然后使用 map.scale - http://developer.anscamobile.com/reference/index/objectscale
CoronaSDK doesn't have a "vector format loader" built in, but is able to draw lines, polygons, circles and the like - you can get more information here:
http://developer.anscamobile.com/reference/factory-functions
With this in mind, you could create your own custom format (in Lua, probably) saying things like "draw a line from here to here" or "there is a circle with this size on this position".
For zooming in/out, you could just add a "parent" for all your graphical objects, call it "map", and use map.scale - http://developer.anscamobile.com/reference/index/objectscale