Feature request XY plane

The new Daslight - for PC and Mac

Moderators: TomHat, simonB

DJMan32
Posts: 386
Joined: Wed Jan 18, 2023 2:18 am
Operating System: Windows

Feature request XY plane

Post by DJMan32 »

It would be nice if we could have the ability to scale the shapes evenly by holding control or a key like that,

also if we could have the ability to move all selected movers relatively instead of resetting them all to one position, that would be nice, like move a fan around or something like that
spanandry
Posts: 1
Joined: Tue Feb 20, 2024 7:54 am
Operating System: Windows

Re: Feature request XY plane

Post by spanandry »

To scale the shapes evenly, you can use the sf::Transformable::setScale method, which takes two parameters: the horizontal and vertical scale factors. If you want to scale the shapes uniformly, you can pass the same value for both parameters. For example, if you want to scale the shape by 50%, you can do: geometry dash

shape.setScale(0.5f, 0.5f);

You can also use the sf::Transformable::scale method, which takes the same parameters, but scales the shape relatively to its current scale. For example, if you want to scale the shape by 50% of its current size, you can do:

shape.scale(0.5f, 0.5f);

You can use the sf::Keyboard::isKeyPressed method to check if a key is pressed, and then apply the scaling accordingly. For example, if you want to scale the shape by 50% when the control key is pressed, you can do something like this:

if (sf::Keyboard::isKeyPressed(sf::Keyboard::LControl))
{
shape.scale(0.5f, 0.5f);
}

To move all selected movers relatively, you can use the sf::Transformable::move method, which takes two parameters: the horizontal and vertical offset. This method moves the shape by the given offset, relative to its current position. For example, if you want to move the shape by 10 pixels to the right and 5 pixels down, you can do:

shape.move(10.f, 5.f);

You can also use the sf::Transformable::setPosition method, which takes the same parameters, but sets the absolute position of the shape. For example, if you want to move the shape to the position (100, 50), you can do:

shape.setPosition(100.f, 50.f);

You can use the sf::Mouse::isButtonPressed method to check if a mouse button is pressed, and then use the sf::Mouse::getPosition method to get the current position of the mouse cursor. You can then use the difference between the current and previous mouse positions to calculate the offset to move the shape. For example, if you want to move the shape by dragging the left mouse button, you can do something like this:

if (sf::Mouse::isButtonPressed(sf::Mouse::Left))
{
sf::Vector2i mousePos = sf::Mouse::getPosition(window);
sf::Vector2f offset = mousePos - prevMousePos;
shape.move(offset);
prevMousePos = mousePos;
}

I hope this helps you improve your program
DJMan32
Posts: 386
Joined: Wed Jan 18, 2023 2:18 am
Operating System: Windows

Re: Feature request XY plane

Post by DJMan32 »

tis is a note to the developers right?
artyfunk2
Posts: 27
Joined: Thu Dec 28, 2023 1:38 pm
Operating System: Windows
Location: Germany

Re: Feature request XY plane

Post by artyfunk2 »

DJMan32 wrote: Tue Feb 20, 2024 4:21 pm tis is a note to the developers right?
yes this is Code.
DJMan32
Posts: 386
Joined: Wed Jan 18, 2023 2:18 am
Operating System: Windows

Re: Feature request XY plane

Post by DJMan32 »

developers: Please don't forget about this

being able to see all selected fixtures on the xy plane for scaling and moving all of them relatively would be nice
Post Reply