Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for zooming from scripting #1560

Merged
merged 3 commits into from Oct 26, 2020
Merged

Support for zooming from scripting #1560

merged 3 commits into from Oct 26, 2020

Conversation

Semphriss
Copy link
Member

Zooming now available to level designers!

zooming

If you have a portion of you level that is bigger or smaller, you can now use zooming to increase the effect on the player :)

Accessible from Camera.set_scale(scale), Camera.scale(scale, time) and Camera.ease_scale(scale, time, easing) where:

  • scale is a decimal number which is the zoom multiplier. 1 is default zoom, The gif uses 0.75. A smaller number = a larger portion of the level visible to the screen.
  • time is a decimal number that represent the time it will take to reach the scale.
  • easing is a string with the name of the easing you want to use, following the format "Ease[Mode][Direction]" where "Mode" is the easing mode (Sine, Exponential, Back, Bounce, etc.) and Direction is In, Out, or InOut. For a ful llist of possibilites, see: https://easings.net/ (note that the name are not exactly the name, the order is different). Examples: "EaseSineInOut", "EaseBounceOut", "EaseBackIn"

@Rusty-Box
Copy link
Member

Is this linked to the magnification setting? And if so, can you also return the zoom back to the original setting?

@Semphriss
Copy link
Member Author

This works in a similar way but is completely independant from the magnification setting. The scale is tied to the camera object, and is applied only to the sector the camera is linked to, similarly to the camera translation.

@Rusty-Box
Copy link
Member

Rusty-Box commented Oct 21, 2020

So, a 200% zoom when magnification is 100 is different from a 200% zoom when magnification is 160 (as an example)?

@Semphriss
Copy link
Member Author

Yes, indeed. A magnification of 200 with a zoom of 200% would result in an overall zoom of 400%.

@Rusty-Box
Copy link
Member

Okay, but doesn't this provide a problem for players with different different settings. For example, if a cutscene zoomes in (based on a magnification of 100) important things may get lost if the same cutscene is viewed by players having a magnification of 200?

@Semphriss
Copy link
Member Author

This problem isn't introduced by this feature, though. Players on smaller/bigger resolutions have the same problem. The difference between what players on 640x480 see and those on 1920x1080 see will be the same at 100% zoom or 500% zoom.

This is a level design thing, and since the feature is for level designers, it will be their job to make sure what they want to show is clear and visible on small resolutions. This is true without this feature, and it will be the same with it :)

src/object/camera.hpp Outdated Show resolved Hide resolved
src/object/camera.hpp Outdated Show resolved Hide resolved
src/video/canvas.cpp Outdated Show resolved Hide resolved
@tobbi tobbi merged commit 44be8d1 into SuperTux:master Oct 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants