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

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
ianwillie
Hello Brian, I have some problems with running the code in your book. I like the style of the book very much and I have learnt a lot as...
New
rmurray10127
Title: Intuitive Python: docker run… denied error (page 2) Attempted to run the docker command in both CLI and Powershell PS C:\Users\r...
New
jskubick
I found an issue in Chapter 7 regarding android:backgroundTint vs app:backgroundTint. How to replicate: load chapter-7 from zipfile i...
New
brunogirin
When I run the coverage example to report on missing lines, I get: pytest --cov=cards --report=term-missing ch7 ERROR: usage: pytest [op...
New
Charles
In general, the book isn’t yet updated for Phoenix version 1.6. On page 18 of the book, the authors indicate that an auto generated of ro...
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
redconfetti
Docker-Machine became part of the Docker Toolbox, which was deprecated in 2020, long after Docker Desktop supported Docker Engine nativel...
New

Other popular topics Top

Devtalk
Reading something? Working on something? Planning something? Changing jobs even!? If you’re up for sharing, please let us know what you’...
1017 16927 374
New
AstonJ
A thread that every forum needs! Simply post a link to a track on YouTube (or SoundCloud or Vimeo amongst others!) on a separate line an...
New
AstonJ
Or looking forward to? :nerd_face:
New
AstonJ
I have seen the keycaps I want - they are due for a group-buy this week but won’t be delivered until October next year!!! :rofl: The Ser...
New
PragmaticBookshelf
“Finding the Boundaries” Hero’s Journey with Noel Rappin @noelrappin Even when you’re ultimately right about what the future ho...
New
PragmaticBookshelf
Learn different ways of writing concurrent code in Elixir and increase your application's performance, without sacrificing scalability or...
New
Help
I am trying to crate a game for the Nintendo switch, I wanted to use Java as I am comfortable with that programming language. Can you use...
New
First poster: bot
The overengineered Solution to my Pigeon Problem. TL;DR: I built a wifi-equipped water gun to shoot the pigeons on my balcony, controlle...
New
New
PragmaticBookshelf
A Ruby-Centric Chat with Noel Rappin @noelrappin Once you start noodling around with Ruby you quickly figure out, as Noel Rappi...
New

Latest in PragProg

View all threads ❯