Origin block does not work as intended

Use this template to make awesome bug reports:

Your username:
GravyStudiosNExT :zap:
What kind of device are you using?:
iPad Mini w/ iOS 9
1 sentence description of the problem (I was doing _________, and then __________ happened): I set the origin to specific coordinates, then used set position for the same coordinates and the objects appeared in slightly different locations.

Steps that the Hopscotch team can take to reproduce my problem every time:

  1. Set an object’s origin to (500,500)
  2. Set another object’s position to (500,500)
  3. Press play.

I expected this to happen:
The objects to appear in the same location.
But instead this happened:
The origin object appeared to the top left of where it should.
Here’s a project as an example:

11 Likes

set origin = from bottom left corner

set position = from center

that’s probably why

6 Likes

That makes sense.

5 Likes

Shouldn’t set origin set the origin point of an object? So, say you have an object 100 by 100 pixels, doing set_origin(0, 0) should set the object’s origin at the top left corner, and set_origin(100, 100) sets the object’s origin to the bottom right corner (the usage of set_origin is set_origin(x, y), where x and y are relative to (0,0) the top left corner of the object).

So like, with an object 5 by 5 pixels:
00000
00000
00000
00000
00000

Set_origin(0, 0) should make the origin:
00000
00000
00000
00000
00000

Set_origin(4,0):
00000
00000
00000
00000
00000

Set_origin(0, 4):
00000
00000
00000
00000
00000

Set_origin(4,4):
00000
00000
00000
00000
00000

Is this what set origin does? (This is what it does in the graphics library is use for C++, SFML)

3 Likes

set origin is bottom left for hopscotch

3 Likes

And the origin of the object is what is affected by set_position. So when you do
set_origin(0,0);
And then:
set_position(500,500)
It places the top left corner at (500,500)

2 Likes

Yeah, okay. I knew that, but otherwise does it operate the same.

2 Likes

in hopscotch, set origin sets the bottom left corner of the sprite to the inputted point and set position does the same but based on the center point of the sprite

3 Likes

Huh, that seems pretty redundant. Couldn’t you do the same thing with set position and width and height?

3 Likes

yeah you could I think

2 Likes

Interesting. I’m always confused with the set origin block.

I’m not the only one!

3 Likes