How do I get C2 to respect image sizes?

Just started using Construct 2? Post your questions here

Post » Tue May 05, 2015 3:44 pm

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?
B
3
Posts: 7
Reputation: 189

Post » Tue May 05, 2015 3:57 pm

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
ImageImageImage
B
71
S
21
G
231
Posts: 3,688
Reputation: 129,352

Post » Tue May 05, 2015 4:44 pm

Your images had a transparent image edge of 1 pixel on each side.
Visual Novel 'Engine' in 100 Events
if you ever have to choose between buying Construct 2 on scirra.com or on Steam, read this: Review
B
22
S
9
G
1
Posts: 787
Reputation: 3,786

Post » Tue May 05, 2015 5:39 pm

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...
B
3
Posts: 7
Reputation: 189

Post » Tue May 05, 2015 5:42 pm

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.
B
3
Posts: 7
Reputation: 189

Post » Tue May 05, 2015 5:48 pm

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?
B
3
Posts: 7
Reputation: 189

Post » Tue May 05, 2015 5:49 pm

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.

Flyingbaloo wrote: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.
Visual Novel 'Engine' in 100 Events
if you ever have to choose between buying Construct 2 on scirra.com or on Steam, read this: Review
B
22
S
9
G
1
Posts: 787
Reputation: 3,786

Post » Tue May 05, 2015 5:56 pm

B
3
Posts: 7
Reputation: 189

Post » Tue May 05, 2015 6:04 pm

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?
Visual Novel 'Engine' in 100 Events
if you ever have to choose between buying Construct 2 on scirra.com or on Steam, read this: Review
B
22
S
9
G
1
Posts: 787
Reputation: 3,786

Post » Tue May 05, 2015 6:58 pm

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
B
3
Posts: 7
Reputation: 189

Next

Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 1 guest