How do I get C2 to respect image sizes?

0 favourites
  • 11 posts
From the Asset Store
A versatile and wide-ranging selection of large to medium-sized creature sounds.
  • I have a project set up at 1024x768 with 2 pictures at 1024x500 (top) and 1024x268 (bottom).

    I indicate their size and their position (0x0 and 0x500), no margins... and no way to get a clean screen where I see no background.

    CAPX: http://s000.tinyupload.com/?file_id=23781348688683097749

    Worse, C2 keeps telling me that these pictures are always 2 pixels bigger (if I click on 1:1).

    This is a result I have while creating a small demo file. In my original project, it's almost better but the bottom part (supposed to react to drag & drop) is visible on the sides of the top image by 1 pixel when I drag the bottom one - showing again that C2 is scaling my top picture somehow: http://i.imgur.com/PFUu3Ep.jpg

    I'm a bit lost as to how C2 handles pictures. How do I get clean results, no 1pixel border, nothing?

    Help?

  • Your source images were not the size you said, and didn't cover the full area (and the large one had an origin of 1,1.

    I've fixed all settings and it works as expected.

    blackhornettechnologies.com/Construct2Stuff/sizes_BHT.capx

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Your images had a transparent image edge of 1 pixel on each side.

  • Thank you so much for the quick answer but the images were the right size out of C2 (I can even see it in my folder, which states said sizes). So something happens inside C2.

    I'm getting insane, the large one is definitely at 0,0. What the...? http://i.imgur.com/1EIrmIo.jpg

    Pics are straight out of Photoshop and there's no transparent border

    And your cap works perfectly...

  • blackhornet, did you change the top image?

    If I click 1:1 the top image stays correctly at 1024x500... Glimmer of hope.

    The bottom one is at 1026x268.

  • Sorry to spam, I now see that when I save the project, the images are getting saved with an extra transparent pixel that is inexistant when I import the picture as a sprite in C2. So my guess is, I only need to understand what creates this transparent 1pixel border.

    Any idea?

  • There are transparent borders on the images, as I said. If you can post your png file or whatever here, we could see if that's the case there and try it with our Construct 2 programs if it does import correctly. So far the plausible explaination is that something went wrong when you created/saved the images with Photoshop.

    Sorry to spam, I now see that when I save the project, the images are getting saved with an extra transparent pixel that is inexistant when I import the picture as a sprite in C2. So my guess is, I only need to understand what creates this transparent 1pixel border.

    Doesn't happen with my C2.

  • This is how it gets exported for me: http://666kb.com/i/cydj1aee26l1mvjlz.png (bottom; so everything alright as it should be)

    I opened the images in the sprite editor and assigned the origin point to top left and positions and sizes correctly and everything lined up neatly. After saving, closing and opening everything still was correct.

    I guess you did try to open the images a second time in the sprite editor and checked out if the size is correct before and after saving?

  • Got it.

    It was adding transparent edges... where I was asking it to add transparent edges, simply.

    Basically I started with all tutorials and the step to click on the "crop" tool became ingrained. It was part of all tests and for me meant making sure that the picture was handled as close to its borders as possible.

    Thank you mindfaQ, you describing your process somehow made me question that automatism with that "crop" icon...

    I would feel really elated right now if I didn't feel so dumb instead.

    Cheers

  • People tend to leave transparent borders around their sprites because of aliasing at edges when rotating the objects, so that's probably where you've got used to that.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)