Once you have selected the "Gameplay & Input" scaling strategy in Unity Editor or Luna Playground, you may need to define your input scaling strategy using the advanced settings.
Luna Replay records the positions of the touch and click events. This means that changing the game resolution yet keeping the positions (just like Scale Gameplay mode does) might lead to the input events being replayed at wrong positions, leading to clicks missing the buttons as illustrated below:
That is why both Luna Playground and Luna Replay Unity plugin have a set of advanced controls which denote how the touches from the recorded capture should land into the target resolution.
In order to make touch positions end up in the correct places in the target area, you have to configure anchoring rules and offset values.
Both Luna Playground and Replay plugin have the scaling controls available next to the video resolution settings.
- Luna Playground
- Unity Editor
Anchors describe how the source rect (original inputs) will be aligned with regards to the target rect (final inputs). There are options to either centre the area, fix the left edge to the left, right edge to the right, or stretch to simply "fill" the target area. Vertical anchors mimic horizontal anchors correspondingly.
- Luna Playground
- Unity Editor
Let's consider a few examples to make it more visual.
Consider a game which has 3 buttons placed at the middle of the screen, each button occupies 1/3 of the available space of the original resolution and is centred. Switching the aspect ratio from 9:16 to 16:9 will keep the buttons centred, but their size will grow to account for wider screen:
In Luna Replay, setting the anchors to "Stretch" will cause the input coordinates to scale so that leftmost point on the original screen corresponds to leftmost point on the target screen, the rightmost corresponds to the rightmost, and so on.
The following example illustrates how the touch coordinates would be mapped onto the new resolution, by using stretch mode:
Consider a game where there is a button placed at the top left corner. Switching the aspect ratio from 9:16 to 16:9 will keep the button in the very same corner, but the size stays the same.
Making the input rectangle align with top left corner will instruct Luna Replay to position the inputs so that the top left corner of the source area matches the top left corner of the target area, but no coordinate transformation will be applied further making sure that clicking even the edge of the button will still produce a click at the very same position. This ensures that clicks do not miss the button because of coordinate scaling.
The following example illustrates this:
The Anchor is set at the Top Left.
Offsets allow Luna Replay to adjust the size of the "resized" area when it gets remapped onto the new resolution. This is suitable when you either want to use anchoring yet still apply some scaling to the area or when using stretched anchors but need to have specific offsets from the edges.
For instance, consider the sketch from the previous example:
Since the aspect ratio changed from portrait to landscape, the rightmost edge of the area will not reach the rightmost edge of the target rectangle.
Changing the horizontal anchors to stretched will make the height respect the original aspect ratio:
Applying the bottom offset allows one to "amend" the aspect ratio if the game requires this to happen:
Tweaking the settings to find the right combination could be challenging and time consuming. In order to simplify this workflow, Luna Playground exposes an interactive diagram that shows the remap happening as you change the settings:
It is advised to set these up in Playground since the diagram provides instant visual feedback and makes it easier to understand the scaling strategy.