Origin and imagepoints

Discussion and feedback on Construct 2

Post » Mon Jul 04, 2016 4:44 am

I've only just noticed that you CANNOT place an origin or imagepoint at half-pixel positions - which makes certain sprite sizes incredibly irritating (like having an odd number of pixels) since your "center" point is always one pixel either left or right. It's not really a big deal unless you have very small/low-res graphics (especially if you're using layer zoom or similar pixelation methods) and you want to do stuff like rotate an object.

The editor allows you to place them at half-pixel increments, but it doesn't save/commit those point coordinates and translate into the game.

Is there a reason it's is like this? How have I only just noticed now and not before?

~Sol
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
80
S
34
G
40
Posts: 3,029
Reputation: 30,393

Post » Mon Jul 04, 2016 9:42 am

It is especially annoying when the sprite needs to be mirrord.
B
33
S
18
G
27
Posts: 2,440
Reputation: 20,344

Post » Mon Jul 04, 2016 10:33 am

what do you mean? ofc it can be placed, depending on your size of sprite, which needs to be 2ˇn example:

if you put on sprite 20x20 on point (10,10) - you have 10 points to left and 10 to right to get 0,10 or 20,10.
if you have a sprite that's 19x19, and you plaec it on point (10,10) - you have 10 to left, and 9 to right side. same happens when you put on 9,9, just opposite ways.
Sea Monsters template - Isometric
Also includes 40 pages PDF of optimizations and "how-to" for your games, and how the "sea monsters" template was built. Follow link for details :)

sea-monsters-templates-and-assets_t162705
B
41
S
14
G
12
Posts: 623
Reputation: 9,359

Post » Mon Jul 04, 2016 10:53 am

saiyadjin wrote: and you plaec it on point (10,10) - you have 10 to left, and 9 to right side.


And this is the problem I'm talking about. It's un-even.

You can't place the origin point at 9.5 (well you can, it just doesn't SAVE there) - only at 9 or 10 - leaving 10 to the left and 9 to the right, or 9 to the left and 10 to the right. Right?

~Sol
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
80
S
34
G
40
Posts: 3,029
Reputation: 30,393

Post » Mon Jul 04, 2016 11:26 am

yes but that happens when you have uneven size of sprite - 1/3/5/7/9... x 1/3/5/7/9... they have no midpoint, but 2/4/6/8... x 2/4/6/8... have midpoints.
Sea Monsters template - Isometric
Also includes 40 pages PDF of optimizations and "how-to" for your games, and how the "sea monsters" template was built. Follow link for details :)

sea-monsters-templates-and-assets_t162705
B
41
S
14
G
12
Posts: 623
Reputation: 9,359

Post » Mon Jul 04, 2016 12:37 pm

saiyadjin wrote:yes but that happens when you have uneven size of sprite - 1/3/5/7/9... x 1/3/5/7/9... they have no midpoint, but 2/4/6/8... x 2/4/6/8... have midpoints.


This was what my original post is about... having a sprite of "un-even" or "odd" amounts of pixels.

My game character(s) are an un-even/odd amount of pixels wide - so they can have a single pixel for a nose or bellybutton, instead of a 2px wide "line". It's incredibly frustrating to juggle imagepoints around to line things up properly for each rotation of my character - only to have it fail as soon as I want to rotate/angle a part of the body as well, and it just looks wrong.

~Sol
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
80
S
34
G
40
Posts: 3,029
Reputation: 30,393

Post » Mon Jul 04, 2016 12:47 pm

did you try resizing sprite with +1 pix in width / height? engine will choose itself the best place to add the pixels so you might not lose your nose :)
Sea Monsters template - Isometric
Also includes 40 pages PDF of optimizations and "how-to" for your games, and how the "sea monsters" template was built. Follow link for details :)

sea-monsters-templates-and-assets_t162705
B
41
S
14
G
12
Posts: 623
Reputation: 9,359

Post » Mon Jul 04, 2016 1:03 pm

If you're not resizing them I would suggest not using image points, and just placing them manually. Hotspot x-1, y+4 etc.
Image points uses some trig that won't always work correctly at that size due to the math with angles.

A non trig type of behavior to replace Pin might be in order here.
It just wouldn't handle scaling very well, or rotations....
Image ImageImage
B
168
S
50
G
163
Posts: 8,221
Reputation: 105,061

Post » Mon Jul 04, 2016 1:20 pm

Yeah I have a few workarounds, like placing manually... it's just, annoying that C2 can't store origin/image points at increments of pixels (at least 0.5) because odd width sprites surely aren't THAT uncommon.

Fortunately in my particular instance, I have already sorted a work-around for the issue, but it was a hard coded case-by-base solution.

I seem to remember CC being able to place the old "hotspot" at any increment of pixel? It's just particularly strange that the C2 image editor allows you to place them at any increment as well, but it rounds it to the nearest whole pixel once you save and close the editor or change to a different animation or frame.

~Sol
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
80
S
34
G
40
Posts: 3,029
Reputation: 30,393


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 4 guests