weheartgames Posted September 12, 2015 Share Posted September 12, 2015 I am creating layer-based export slices (in the Export persona, selecting a layer then clicking "Create Slice" at the bottom of the layers palette). When I export retina assets, they often do not have even-numbered pixel dimensions. This is not useful for app or game development, as the @2x graphics need to be exactly double the size of the non-retina graphics. Is there anyway to force it to export even-numbered pixel dimensions for @2x? Thanks! -Mike Quote Link to comment Share on other sites More sharing options...
Staff Callum Posted September 14, 2015 Staff Share Posted September 14, 2015 Hi Mike, Welcome to the Forums :) The Export Persona Persona will export depending on the size of the slice. If you have your size not aligned to a whole pixel it will make the exported picture odd. I have tried this at my end and it is working fine. Please could you attach one of your files for me to try and recreate this issue with? Once I have looked at the file I will delete it :) C Quote Please tag me using @ in your reply so I can be sure to respond ASAP. Link to comment Share on other sites More sharing options...
weheartgames Posted September 14, 2015 Author Share Posted September 14, 2015 I guess my thought is that slices should *always* be aligned to a whole pixel (or rather, a whole *point*) so that exported sizes are always accurate. When I select a Layer in the Export Persona and click the "Create Slice" button, it appears to snap to whole points, given the dimensions shown for the slice (see attachment). If those dimensions are capable of decimal points, it should definitely show decimal points. I'm having a hard time imagining anyone wanting that behaviour though. Is there an easy way to adjust a slice's size numerically? The only way I can see is to zoom way in and scale each side it to a point edge. This is tedious enough that I would probably rather use other software... :( And thanks, by the way! This is my first real project with AD, and I'm loving it a lot. Reliably getting assets out of it is pretty critical though! :) Quote Link to comment Share on other sites More sharing options...
Staff MEB Posted September 14, 2015 Staff Share Posted September 14, 2015 Hi weheartgames, Welcome to Affinity Forums :) You can enable Force Pixel Alignment from the Persona toolbar on top (or go to menu View ▸ Snapping Manager...). This will ensure that all your assets will be aligned to the pixel grid. Quote A Guide to Learning Affinity Software Link to comment Share on other sites More sharing options...
weheartgames Posted September 14, 2015 Author Share Posted September 14, 2015 Ah, I see what the problem is now. I have my document set up using the Page Preset of "iPad Air (Retina)". I was assuming (hoping) that the pixel snapping for creating slices would snap to points, not to pixels. Is there any way to make it do that? I have a slice that is showing as 43 x 39, but when I export it at 1x, it exports to 21 x 19, and the @2x file is 43 x 39. This doesn't work for me (or any game dev), unfortunately. The files need to be precise multiples of each other to work properly. Quote Link to comment Share on other sites More sharing options...
weheartgames Posted September 14, 2015 Author Share Posted September 14, 2015 I just had a thought: If I change my DPI to 72, and recreate my slices with pixel snapping turned on, will this work the way I'm expecting it to? For this project, I only have vector layers, so that would be ok... this time. Quote Link to comment Share on other sites More sharing options...
weheartgames Posted September 14, 2015 Author Share Posted September 14, 2015 Sorry for the multiple posts. Changing the DPI of the document seems to mess with the Export Persona's measurements, actually. I'm attaching the file with just the one asset in it. This layer was created BEFORE changing the DPI. If you switch to the Export Persona you can see that the "Tower1Projectile" slice actually shows up empty. It also exports an empty PNG. The bounding box for it does not show in the document view, and the dimensions of it (in the "Transform" palette) still show as the dimensions it was BEFORE switching the DPI. I created a new layer, added a 5x5 rectangle to it and created a new slice from that, and that works the way I expect. Quote Link to comment Share on other sites More sharing options...
Staff MEB Posted September 14, 2015 Staff Share Posted September 14, 2015 Hi weheartgames, No problem. Feel free to post at will ^_^ Currently slices don't update if you change the size of the document. There's still some work to do here. There's also other improvements planned for the Export persona later (including previews). We just need some time to get there ;) Quote A Guide to Learning Affinity Software Link to comment Share on other sites More sharing options...
weheartgames Posted September 14, 2015 Author Share Posted September 14, 2015 Yeah, I was expecting to have to re-create the slice, but that's exactly my issue. When I recreate that slice, the measurements are wrong, and the bounding box doesn't show up. :( Quote Link to comment Share on other sites More sharing options...
Staff Ben Posted September 15, 2015 Staff Share Posted September 15, 2015 Slices are always aligned to whole document pixels. A 2x and 3x should give you documents that are 2 and 3 times the original whole pixel size. When exporting a linked slice, the bounding box for that layer being exported is widened to whole pixels. We do have a bit of code that corrects documents that were created with retina DPI (144, for example). This might have some affect like you are describing. They are assumed to already be in retina format, and that might be an odd pixel count. The 1x version will then be 50% of the original size instead (which will be halved then rounded - so a 13 pixel document would come out at 6 pixel, for example). Use 72dpi, then your document is assumed to be in standard mode, and 2x and 3x export will work as expected. If you have an example, I can look into it. Quote SerifLabs team - Affinity Developer Software engineer - Photographer - Guitarist - Philosopher iMac 27" Retina 5K (Late 2015), 4.0GHz i7, AMD Radeon R9 M395 MacBook (Early 2015), 1.3GHz Core M, Intel HD 5300 iPad Pro 10.5", 256GB Link to comment Share on other sites More sharing options...
Staff Ben Posted September 15, 2015 Staff Share Posted September 15, 2015 Is there an easy way to adjust a slice's size numerically? The only way I can see is to zoom way in and scale each side it to a point edge. This is tedious enough that I would probably rather use other software... :( You can adjust the position and size of a slice using the Transform panel. Quote SerifLabs team - Affinity Developer Software engineer - Photographer - Guitarist - Philosopher iMac 27" Retina 5K (Late 2015), 4.0GHz i7, AMD Radeon R9 M395 MacBook (Early 2015), 1.3GHz Core M, Intel HD 5300 iPad Pro 10.5", 256GB Link to comment Share on other sites More sharing options...
weheartgames Posted September 15, 2015 Author Share Posted September 15, 2015 Whoops, I thought I had attached that document a couple posts ago. Slices snapping to whole pixels: that's great! But my issue is that I want them to snap to whole points, rather than pixels. My document was set to 1024x768 points, with a dpi of 144 (so that I still had the resolution to export @2x without issue, or that was my intention, in case I used any pixel layers). So I was getting slices that were snapping to odd-numbered pixel dimensions, which exported @2x graphics at that size. Which means the "@1x" graphics could not be exactly half the size of the @2x graphics. In any case, the attachment here demonstrates a problem I found when trying to change my document resolution to 72, to try to force the slices to be calculated with whole pixels at the "@1x" level, rather than at the @2x level. When I did that, I had problems creating layer slices from layers that had already existed in the document, *before* the resolution change. There was no problem making layer-based slices from newly-created layers. Quote Link to comment Share on other sites More sharing options...
weheartgames Posted September 15, 2015 Author Share Posted September 15, 2015 Just found this other post from another user who seems to be having the same issue with changing a document's resolution: https://forum.affinity.serif.com/index.php?/topic/12011-scaling-guidesslices-with-resolution/ Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.