Apple Game Frameworks and Technologies: SVG instead of PNG

So Xcode 12 added native support for SVG files. From Apple’s Xcode 12 release notes:

Asset Catalogs
New Features

Added support for Scalable Vector Graphic (SVG) image assets. These preserve their vector representation with deployment targets of macOS 10.15 or later, iOS 13 or later, and iPadOS 13 or later. (18389814)

Instead of having to handle @1x, @2x, and @3x as suggested in chapter 1 (“Creating Scenes with Sprites and Nodes”), which is also OK, theoretically it would be possible to have something like this:

Those are SVG files set as “Universal” that automagically scale according to the device screen.

Is someone here familiar with this new approach?
I wonder if there may be performance issues…

Please let me know what you think, thanks!

2 Likes

Hi, Fernando.

I haven’t used the new SVG support, but I’d imagine it works similarly to PDF support. Having said that, I’ll be honest… I’ve never favored using PDFs over their PNG counterparts.

Many of my assets are created in apps like Affinity Designer, so exporting at multiple sizes isn’t a problem or a maintenance nightmare. And, in terms of overall app size, there’s also not a lot of gain using PDFs since Xcode converts the PDF to the properly-sized PNGs.

Of course, I’ll need to play around with the SVG support before making a final determination, but I’m not ready to move away from PNGs any time soon. They’ve served me well, and I’m not feeling hassled enough by their use to jump ship… not yet, but I suspect it’ll happen one day.

2 Likes

Understood, thanks for the input!

1 Like