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

0 favourites
  • 1 posts
From the Asset Store
220 Food Sprites in 16x16 pixel size. Perfect for items for a retro style game.
  • 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?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)