How do I set the size of an SVG before loading into Sprite?

Get help using Construct 2

Post » Tue Apr 25, 2017 5:50 pm

I've been testing SVGs with Construct 2 by loading them into Sprites. All the graphics I make for my projects are vector so I could hugely benefit from using SVGs and loading them to any size I need. The problem is I can't control the size at which they are rasterized. If I export my SVGs as responsive Construct somehow chooses a fixed size for them. For example a 64x64 SVG is rasterized at 150x150 for some reason. If I stretch the image to 128x64 Construct makes it 300x150. I learned that by using the "Load image..." command with "Resize to image size". Later I tried the same SVG at 256x256 and again it was resized to 150x150.

On the other hand if I export my SVGs as non-responsive Construct rasterizes them at their native size. The same 64x64 SVG will be rasterized at that size instead of 150x150. The problem is that if I can't dynamically control the native size of the SVGs they are not a lot more useful than PNGs. They are smaller but I will still need multiple sets of them with different sizes.

My question is, how can I control the size of responsive SVGs? I want to make them smaller or bigger depending on screen size before they are loaded and therefore rasterized. I know there is no direct command for this but, is it maybe doable with javascript commands? Any thoughts?
Posts: 22
Reputation: 2,048

Return to How do I....?

Who is online

Users browsing this forum: dop2000 and 24 guests