backslash-f

backslash-f

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!

Marked As Solved

Paradox927

Paradox927

Author and Editor at PragProg

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.

Also Liked

backslash-f

backslash-f

Understood, thanks for the input!

Popular Prag Prog topics Top

jon
Some minor things in the paper edition that says “3 2020” on the title page verso, not mentioned in the book’s errata online: p. 186 But...
New
brianokken
Many tasks_proj/tests directories exist in chapters 2, 3, 5 that have tests that use the custom markers smoke and get, which are not decl...
New
raul
Page 28: It implements io.ReaderAt on the store type. Sorry if it’s a dumb question but was the io.ReaderAt supposed to be io.ReadAt? ...
New
AleksandrKudashkin
On the page xv there is an instruction to run bin/setup from the main folder. I downloaded the source code today (12/03/21) and can’t see...
New
AndyDavis3416
@noelrappin Running the webpack dev server, I receive the following warning: ERROR in tsconfig.json TS18003: No inputs were found in c...
New
brunogirin
When trying to run tox in parallel as explained on page 151, I got the following error: tox: error: argument -p/–parallel: expected one...
New
taguniversalmachine
Hi, I am getting an error I cannot figure out on my test. I have what I think is the exact code from the book, other than I changed “us...
New
Henrai
Hi, I’m working on the Chapter 8 of the book. After I add add the point_offset, I’m still able to see acne: In the image above, I re...
New
ggerico
I got this error when executing the plot files on macOS Ventura 13.0.1 with Python 3.10.8 and matplotlib 3.6.1: programming_ML/code/03_...
New
bjnord
Hello @herbert ! Trying to get the very first “Hello, Bracket Terminal!" example to run (p. 53). I develop on an Amazon EC2 instance runn...
New

Other popular topics Top

Devtalk
Hello Devtalk World! Please let us know a little about who you are and where you’re from :nerd_face:
New
Devtalk
Reading something? Working on something? Planning something? Changing jobs even!? If you’re up for sharing, please let us know what you’...
1016 16836 371
New
malloryerik
Any thoughts on Svelte? Svelte is a radical new approach to building user interfaces. Whereas traditional frameworks like React and Vue...
New
siddhant3030
I’m thinking of buying a monitor that I can rotate to use as a vertical monitor? Also, I want to know if someone is using it for program...
New
PragmaticBookshelf
Learn different ways of writing concurrent code in Elixir and increase your application's performance, without sacrificing scalability or...
New
wmnnd
Here’s the story how one of the world’s first production deployments of LiveView came to be - and how trying to improve it almost caused ...
New
gagan7995
API 4 Path: /user/following/ Method: GET Description: Returns the list of all names of people whom the user follows Response [ { ...
New
AstonJ
We’ve talked about his book briefly here but it is quickly becoming obsolete - so he’s decided to create a series of 7 podcasts, the firs...
New
AstonJ
If you want a quick and easy way to block any website on your Mac using Little Snitch simply… File > New Rule: And select Deny, O...
New
New

Latest in PragProg

View all threads ❯