Discuss Scratch

NKWest
Scratcher
11 posts

Zooming effect

So I have attempted and failed many times trying to code a zooming effect for my sprites. Basically you have two clones at specific points, but you when you press a key, it will zoom out or in(relative to the mouse point). I try to search up a tutorial, but it only show how to zoom in the scripts which is not helpful.

In order to successfully accomplished this:

- the two clones must zoom in and out relative to the mouse position
- it should not stick together when try to zoom at a different angle.
footsocktoe
Scratcher
1000+ posts

Zooming effect

NKWest wrote:

So I have attempted and failed many times trying to code a zooming effect for my sprites. Basically you have two clones at specific points, but you when you press a key, it will zoom out or in(relative to the mouse point). I try to search up a tutorial, but it only show how to zoom in the scripts which is not helpful.

In order to successfully accomplished this:

- the two clones must zoom in and out relative to the mouse position
- it should not stick together when try to zoom at a different angle.

What do you mean by “zoom”? Change size? Have you tried using the change size blocks?
NKWest
Scratcher
11 posts

Zooming effect

zoom :from top looking down perpective, increasing or decreasing size and distance, like a google map but with objects instead of an image.

Last edited by NKWest (Aug. 19, 2017 03:36:46)

asivi
Scratcher
1000+ posts

Zooming effect

Two only? You don`t need clones.
asivi
Scratcher
1000+ posts

Zooming effect

NKWest wrote:

zoom :from top looking down perpective, increasing or decreasing size and distance, like a google map but with objects instead of an image.

Perspective like Google Maps? A google map is a plain view zoom in-out focused in a selected point.
Please explain.

Last edited by asivi (Aug. 19, 2017 10:50:51)

asivi
Scratcher
1000+ posts

Zooming effect

Not sure about you want, however start creating linked variables(off-set) relative to the mous-pointer for one of those clones or separated Sprites, then do the same for the second clone or Sprite but doing linked(off-set) to the first instead of the mouse-pointer, so you can move both Sprites or clones with reliability. To zoom you need to use the size effect and vary coordinates accordingly, i cannot help you with(i'm too bad with maths ), just try to figure the apropiate formulae.
asivi
Scratcher
1000+ posts

Zooming effect

I've worked a while with and there is a problem because sprites can`t go offscrenn but there is a workaround at least, that is the reason i said to link one Sprite with the other, so you do not allow to go offscreen the first Sprite i mentioned.

Rethinking: you can link both sprites to mouse coordinates.

Last edited by asivi (Aug. 19, 2017 12:17:08)

asivi
Scratcher
1000+ posts

Zooming effect

Also create tiny costumes to avoid problems with sizes.
andyhanwu
Scratcher
76 posts

Zooming effect

NKWest
Scratcher
11 posts

Zooming effect

something like this https://scratch.mit.edu/projects/169092930/

Last edited by NKWest (Aug. 19, 2017 15:13:48)

NKWest
Scratcher
11 posts

Zooming effect

like a desmos graph, picks 2 point then zoom in and out but as you can see the clones can sometimes stick together

Last edited by NKWest (Aug. 19, 2017 18:14:38)

gtoal
Scratcher
1000+ posts

Zooming effect

NKWest wrote:

So I have attempted and failed many times trying to code a zooming effect for my sprites. Basically you have two clones at specific points, but you when you press a key, it will zoom out or in(relative to the mouse point). I try to search up a tutorial, but it only show how to zoom in the scripts which is not helpful.

zooming in is the same as zooming out. You just start the display already zoomed in, and revert to normal scale when you want to zoom out.
NKWest
Scratcher
11 posts

Zooming effect

gtoal wrote:

NKWest wrote:

So I have attempted and failed many times trying to code a zooming effect for my sprites. Basically you have two clones at specific points, but you when you press a key, it will zoom out or in(relative to the mouse point). I try to search up a tutorial, but it only show how to zoom in the scripts which is not helpful.

zooming in is the same as zooming out. You just start the display already zoomed in, and revert to normal scale when you want to zoom out.

i will try that
Scratch-Minion
Scratcher
1000+ posts

Zooming effect

The reason that the clones sometimes stick together is that there are limits to x position, y position and size. When a key is pressed and you try to change beyond these limits, x position, y position and size are assigned to their limits.
Also Scratch will only calculate x position, y position and size as integers not real numbers including decimal places.
This makes calculations most inaccurate when you zoom so that the clones are very close to the mouse.

To avoid this, you would need to use variables for x position, y position and size in ALL your calculations, then set x position, y position and size for the clones from their corresponding variables.
PUGSROCK333
Scratcher
1 post

Zooming effect

how do i change the zoom effect on one of my sprites??? pls get back to me ASAP!!!
blocksrostudio
Scratcher
2 posts

Zooming effect

How to do a zoom in transition!
when green flag clicked
repeat (however much u want it for)
change size by (1)

end

Last edited by blocksrostudio (July 11, 2020 21:52:21)

Cutie_Pooge
Scratcher
500+ posts

Zooming effect

blocksrostudio wrote:

How to do a zoom in transition!
when green flag clicked
repeat (however much u want it for)
change size by (1)

end
First of all, your code isn't what they wanted,
This post is 3 years old, please don't necropost.
Harakou
Scratcher
1000+ posts

Zooming effect

PUGSROCK333 wrote:

how do i change the zoom effect on one of my sprites??? pls get back to me ASAP!!!
Hi! If you need help, please create a new topic in this forum for your question. People aren't likely to see your question here and instead will respond to the original question. Or, they'll chide you or “necroposting.” Either way, a new thread is a much better way to get the help you need.

Powered by DjangoBB