MouseDance MouseDance
MouseDance MouseDance
MouseDance User Docs powered by DocFx, DiscordFx

Search Results for

    Class BeatmapAreaAdjuster

    Adds an optional position offset to the 4:3 area of the Beatmap, especially meant for use in portrait mode (i.e. mobile).

    Inheritance
    Object
    Object
    Component
    Behaviour
    MonoBehaviour
    BeatmapAreaAdjuster
    Namespace: MouseDance.Runtime
    Assembly: MouseDance.Runtime.dll
    Syntax
    public class BeatmapAreaAdjuster : MonoBehaviour
    Remarks

    Beatmaps are positioned only in a 4:3 area that is automatically resized to fit on screen, centered. But during portrait mode, you may want to anchor the area closer to the bottom or to the top, depending on your game. That is what the BeatmapAreaAdjuster can do.

    This component should be attached to the UI Canvas so that it can receive OnRectTransformDimensionsChange events.

    Fields

    _canvasTransform

    Declaration
    [SerializeField]
    [Tooltip("Used to obtain the screen size.")]
    protected RectTransform _canvasTransform
    Field Value
    Type Description
    RectTransform

    _screenAdjust

    Declaration
    [SerializeField]
    [Tooltip("The Beatmap Area that we will adjust.")]
    protected RectTransform _screenAdjust
    Field Value
    Type Description
    RectTransform

    _screenPosLandscape

    Declaration
    [SerializeField]
    [Tooltip("Offset to the Beatmap Area's position when the screen is in landscape. Leave at (0,0) if you don't want any offset.")]
    protected Vector2 _screenPosLandscape
    Field Value
    Type Description
    Vector2

    _screenPosPortrait

    Declaration
    [SerializeField]
    [Tooltip("Offset to the Beatmap Area's position when the screen is in portrait and the aspect ratio is something else (one that isn't specified directly here). Leave at (0,0) if you don't want any offset.")]
    protected Vector2 _screenPosPortrait
    Field Value
    Type Description
    Vector2

    _screenPosPortrait10by16

    Declaration
    [SerializeField]
    [Tooltip("Offset to the Beatmap Area's position when the screen is in portrait and the aspect ratio detected is 10:16. Leave at (0,0) if you don't want any offset.")]
    [InspectorName("Screen Pos Portrait 10:16")]
    protected Vector2 _screenPosPortrait10by16
    Field Value
    Type Description
    Vector2

    _screenPosPortrait2by3

    Declaration
    [SerializeField]
    [Tooltip("Offset to the Beatmap Area's position when the screen is in portrait and the aspect ratio detected is 2:3. Leave at (0,0) if you don't want any offset.")]
    [InspectorName("Screen Pos Portrait 2:3")]
    protected Vector2 _screenPosPortrait2by3
    Field Value
    Type Description
    Vector2

    Methods

    OnRectTransformDimensionsChange()

    Declaration
    [ContextMenu("Adjust")]
    protected virtual void OnRectTransformDimensionsChange()

    Extension Methods

    Util.SetLayerDeep(Component, LayerMask)
    Util.SetLayerDeep(Component, Int32)
    Util.SetLayerDeep(Component, LayerMask, Stack<Transform>)