- Home /
This post has been wikified, any user with enough reputation can edit it.
increasing scale based on mouse position
I'm making a map editor for my game, and i'm trying to scale the selected block based on mouse location... I'll give you guys an example:
Here's a selected block:
When I move my mouse to the left it makes:
So that's basically it !
I tryed to take the mouse direction like so:
int MouseDir = 0;
if (mousepos.x <= 700)
{
MDir = 1;
}
if (mousepos.x >= 700)
{
MDir = -1;
}
if (mousepos.y <= 200)
{
MDir = 2;
}
if (mousepos.y >= 200)
{
MDir = -2;
}
Then based on that I made "+1" to the X scale if the mouse coordinates have changed and if the MouseDirection is, for example, "1".
I'm not really good for explanations sorry about that, but thanks for give a try!
capture.png
(5.0 kB)
capture.png
(6.2 kB)
Comment
Your answer
Follow this Question
Related Questions
Put multiple object in one mouse move 1 Answer
Terrain Tree Placement 0 Answers
Preview selected gameobject at hit.point 1 Answer
Lego brick placement 0 Answers
Default Parent On Editor 1 Answer