Invert horizontal camera movement

Hi, total newbie here! I’m creating a piano music app, so obviously I have a few dozen keys as sprite objects on screen. I’d like to be able to drag the octaves horizontally and instead of moving each key object individually, I’ll just move the layer camera.

But because the camera moves in the opposite direction to my draggable scrollbar object, I’m multiplying the X position by -1 to get a negative value and correct the direction.

Change the X position of camera (layer: "Keys"): set to Scrollbar.PointX("Center") *-1

This seems wrong. Is there a better solution to move dozens of objects at once?

2 Likes

You have one action to do something
I can’t understand how you could even think it is wrong?

For me it would be perfect solution

BTW moving whole layer alone instead of each keys is good idea

I really have hard time what you find wrong in it?

2 Likes

The only thing I don’t like about the coordinate system is how Y goes down with positive numbers and up with negative numbers, it’s confusing.

Gdevelop isn’t the only engine that uses this thing. Other game engines use this type of coordination. Pygame uses this coordination system, where Y is reversed.

1 Like

Oh, that’s good to know, still kinda confusing, though.

1 Like

A lot engines uses same system like V9um mentioned
And not even engines a lot programs in fact but whatever

And if you think about it
How do you populate even very text box in which you gonna write your next reply?

Because it goes from left to right and from top to bottom
So if right is + then by same logic would down not make sense to be also + ?

And that is easy way to remember where should go + and where - on each axis

But take a graph into perspective, on a graph positive Y is facing upwards and negative Y is downwards, and positive X is right and negative X is left, does it also not make sense to have it that way?

It does for graph
Not for many other things

Going by calculator example vs text box in which you type reply

In text box actually any text box you would input text
It goes from left to right

From which side to which side it goes on every single calculator you saw in your life?

For coloring something you need 3 colors Red Green Blue RGB
Then why so many programs like aseprite or photoshop or gimp use HSL or HSB or HSBA (actually most of them use HSB/L A and Hex)
And now creating styles for apps or web pages use hex?

And i can go all day giving examples how in one scenario something is one way where in other scenario it will be different

Its just how it adapted in many cases

But let me give you my favorite
In playstation or DVD or whatever that accept disks
Eject/open button is always either on side or somewhere above deck itself so when you press it it does not obstruct you opening it

Now WTF is this?

Who in his right mind decided that button to open deck for cd/dvd rom in your PC which in 99% cases is approached from top by your hand
Should be placed UNDER the deck?
So each time you gonna most likely hit your hand with deck

And there are A LOT more stuff i could list that makes little to no sense

1 Like

That makes sense.
And oof on that last part.