Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » how to calculate position based on scroll X-Y AND mouse X-Y
- -Paths-
-
100+ posts
how to calculate position based on scroll X-Y AND mouse X-Y
i've tried many things but none of them work properly, i need a certain clone to go to mouse position relative to scroll position as well.
- awesome-llama
-
1000+ posts
how to calculate position based on scroll X-Y AND mouse X-Y
I am assuming what you are wanting to do is give the clone it's own x/y position based on where the mouse is on the screen (but taking into account scrolling).
You would have to add/subtract the mouse position and the scroll position. I am not sure of the directions of your scroll variables or anything else specific, so I can't tell you which one it will be.
You would have to add/subtract the mouse position and the scroll position. I am not sure of the directions of your scroll variables or anything else specific, so I can't tell you which one it will be.
- -Paths-
-
100+ posts
how to calculate position based on scroll X-Y AND mouse X-Y
( the link; https://turbowarp.org/576351501/editor/ )
i know you add / subtract but any combination i try never works…
i know you add / subtract but any combination i try never works…
Last edited by -Paths- (Sept. 28, 2021 20:00:54)
- Yusei-Fudo-Test
-
30 posts
how to calculate position based on scroll X-Y AND mouse X-Y
Not getting the situation too well, but this might help:
First, give the clone an x and y position by making those 2 variables for this sprite only, and set them to set values and clone a clone.
To position something on a scrolling level, do this:
First, give the clone an x and y position by making those 2 variables for this sprite only, and set them to set values and clone a clone.
set [x v] to [some position]
set [y v] to [some position]
create clone of (myself v)
To position something on a scrolling level, do this:
go to x: ((object x position on level::grey)-(Camera x)) y: ((object y position on level::grey)-(Camera Y))
- Discussion Forums
- » Help with Scripts
-
» how to calculate position based on scroll X-Y AND mouse X-Y