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 Pragmatic Bookshelf topics Top

conradwt
First, the code resources: Page 237: rumbl_umbrella/apps/rumbl/mix.exs Note: That this file is missing. Page 238: rumbl_umbrella/app...
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
jskubick
I’m running Android Studio “Arctic Fox” 2020.3.1 Patch 2, and I’m embarrassed to admit that I only made it to page 8 before running into ...
New
brunogirin
When installing Cards as an editable package, I get the following error: ERROR: File “setup.py” not found. Directory cannot be installe...
New
New
hazardco
On page 78 the following code appears: <%= link_to ‘Destroy’, product, class: ‘hover:underline’, method: :delete, data: { confirm...
New
a.zampa
@mfazio23 I’m following the indications of the book and arriver ad chapter 10, but the app cannot be compiled due to an error in the Bas...
New
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

AstonJ
Or looking forward to? :nerd_face:
New
Rainer
My first contact with Erlang was about 2 years ago when I used RabbitMQ, which is written in Erlang, for my job. This made me curious and...
New
AstonJ
We have a thread about the keyboards we have, but what about nice keyboards we come across that we want? If you have seen any that look n...
New
AstonJ
There’s a whole world of custom keycaps out there that I didn’t know existed! Check out all of our Keycaps threads here: https://forum....
New
PragmaticBookshelf
Rust is an exciting new programming language combining the power of C with memory safety, fearless concurrency, and productivity boosters...
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
AstonJ
This looks like a stunning keycap set :orange_heart: A LEGENDARY KEYBOARD LIVES ON When you bought an Apple Macintosh computer in the e...
New
PragmaticBookshelf
Learn different ways of writing concurrent code in Elixir and increase your application's performance, without sacrificing scalability or...
New
Maartz
Hi folks, I don’t know if I saw this here but, here’s a new programming language, called Roc Reminds me a bit of Elm and thus Haskell. ...
New
PragmaticBookshelf
Build efficient applications that exploit the unique benefits of a pure functional language, learning from an engineer who uses Haskell t...
New