TopDown Engine  v3.6
MoreMountains.Tools.MMSpriteMask Class Reference

This class will automatically look for sprite renderers, particle systems, tilemaps in the scene, and change their SpriteMaskInteraction settings according to the one set in the inspector Use the NoMask tag on objects you don't want automatically setup More...

Inheritance diagram for MoreMountains.Tools.MMSpriteMask:
MoreMountains.Tools.MMEventListener< MMSpriteMaskEvent >

Public Types

enum  Timescales { Timescales.Scaled, Timescales.Unscaled }
 the possible timescales this mask can operate on More...
 

Public Member Functions

virtual void MoveMaskTo (Vector2 newPosition, Vector2 newSize, float duration, MMTween.MMTweenCurve curve)
 Moves the mask to a new size and position for a certain duration and along a certain curve More...
 
virtual void ExpandAndMoveMaskTo (Vector2 newPosition, Vector2 newSize, float duration, MMTween.MMTweenCurve curve)
 Moves the mask to a new size and position after having expanded to encompass its origin size/position and the destination's size/position More...
 
virtual void OnMMEvent (MMSpriteMaskEvent spriteMaskEvent)
 Catches sprite mask events More...
 
- Public Member Functions inherited from MoreMountains.Tools.MMEventListener< MMSpriteMaskEvent >
void OnMMEvent (T eventType)
 

Public Attributes

float ScaleMultiplier = 100f
 the scale multiplier to apply to the sprite mask More...
 
bool AutomaticallySetupSpriteRenderers = true
 whether or not all sprite renderers should be converted More...
 
bool AutomaticallySetupParticleSystems = true
 whether or not all particle systems should be converted More...
 
bool AutomaticallySetupTilemaps = true
 whether or not all tilemaps should be converted More...
 
bool CatchEvents = true
 if this is true, this mask will move when catching a sprite mask event More...
 
Timescales Timescale = Timescales.Unscaled
 the timescale this mask operates on More...
 
SpriteMaskInteraction MaskInteraction = SpriteMaskInteraction.VisibleInsideMask
 the type of interaction to apply to all renderers More...
 

Protected Member Functions

virtual void Start ()
 On Awake we setup our objects More...
 
virtual void SetupMaskSettingsAutomatically ()
 Looks for mask settings and updates them More...
 
virtual IEnumerator MoveMaskToCoroutine (Vector2 newPosition, Vector2 newSize, float duration, MMTween.MMTweenCurve curve)
 Coroutine that moves the mask More...
 
virtual IEnumerator ExpandAndMoveMaskToCoroutine (Vector2 newPosition, Vector2 newSize, float duration, MMTween.MMTweenCurve curve)
 A coroutine that expands the mask to cover both its current position and its destination area, then resizes itself to match the destination size More...
 
virtual Vector3 ComputeTargetPosition (Vector3 newPosition)
 Determines the new position of the mask More...
 
virtual Vector3 ComputeTargetScale (Vector3 newScale)
 Determines the scale of the mask More...
 
virtual void OnEnable ()
 On enable we start listening for events More...
 
virtual void OnDisable ()
 On disable we stop listening for events More...
 

Protected Attributes

Vector3 _initialPosition
 
Vector3 _initialScale
 
Vector3 _newPosition
 
Vector3 _newScale
 
Vector3 _targetPosition
 
Vector3 _targetScale
 

Properties

virtual float? MaskTime [get]
 

Detailed Description

This class will automatically look for sprite renderers, particle systems, tilemaps in the scene, and change their SpriteMaskInteraction settings according to the one set in the inspector Use the NoMask tag on objects you don't want automatically setup

Member Enumeration Documentation

◆ Timescales

the possible timescales this mask can operate on

Enumerator
Scaled 
Unscaled 

Member Function Documentation

◆ ComputeTargetPosition()

virtual Vector3 MoreMountains.Tools.MMSpriteMask.ComputeTargetPosition ( Vector3  newPosition)
protectedvirtual

Determines the new position of the mask

Parameters
newPosition
Returns

◆ ComputeTargetScale()

virtual Vector3 MoreMountains.Tools.MMSpriteMask.ComputeTargetScale ( Vector3  newScale)
protectedvirtual

Determines the scale of the mask

Parameters
newScale
Returns

◆ ExpandAndMoveMaskTo()

virtual void MoreMountains.Tools.MMSpriteMask.ExpandAndMoveMaskTo ( Vector2  newPosition,
Vector2  newSize,
float  duration,
MMTween.MMTweenCurve  curve 
)
virtual

Moves the mask to a new size and position after having expanded to encompass its origin size/position and the destination's size/position

Parameters
newPosition
newSize
duration
curve

◆ ExpandAndMoveMaskToCoroutine()

virtual IEnumerator MoreMountains.Tools.MMSpriteMask.ExpandAndMoveMaskToCoroutine ( Vector2  newPosition,
Vector2  newSize,
float  duration,
MMTween.MMTweenCurve  curve 
)
protectedvirtual

A coroutine that expands the mask to cover both its current position and its destination area, then resizes itself to match the destination size

Parameters
newPosition
newSize
duration
curve
Returns

◆ MoveMaskTo()

virtual void MoreMountains.Tools.MMSpriteMask.MoveMaskTo ( Vector2  newPosition,
Vector2  newSize,
float  duration,
MMTween.MMTweenCurve  curve 
)
virtual

Moves the mask to a new size and position for a certain duration and along a certain curve

Parameters
newPosition
newSize
duration
curve

◆ MoveMaskToCoroutine()

virtual IEnumerator MoreMountains.Tools.MMSpriteMask.MoveMaskToCoroutine ( Vector2  newPosition,
Vector2  newSize,
float  duration,
MMTween.MMTweenCurve  curve 
)
protectedvirtual

Coroutine that moves the mask

Parameters
newPosition
newSize
duration
curve
Returns

◆ OnDisable()

virtual void MoreMountains.Tools.MMSpriteMask.OnDisable ( )
protectedvirtual

On disable we stop listening for events

◆ OnEnable()

virtual void MoreMountains.Tools.MMSpriteMask.OnEnable ( )
protectedvirtual

On enable we start listening for events

◆ OnMMEvent()

virtual void MoreMountains.Tools.MMSpriteMask.OnMMEvent ( MMSpriteMaskEvent  spriteMaskEvent)
virtual

Catches sprite mask events

Parameters
spriteMaskEvent

◆ SetupMaskSettingsAutomatically()

virtual void MoreMountains.Tools.MMSpriteMask.SetupMaskSettingsAutomatically ( )
protectedvirtual

Looks for mask settings and updates them

◆ Start()

virtual void MoreMountains.Tools.MMSpriteMask.Start ( )
protectedvirtual

On Awake we setup our objects

Member Data Documentation

◆ _initialPosition

Vector3 MoreMountains.Tools.MMSpriteMask._initialPosition
protected

◆ _initialScale

Vector3 MoreMountains.Tools.MMSpriteMask._initialScale
protected

◆ _newPosition

Vector3 MoreMountains.Tools.MMSpriteMask._newPosition
protected

◆ _newScale

Vector3 MoreMountains.Tools.MMSpriteMask._newScale
protected

◆ _targetPosition

Vector3 MoreMountains.Tools.MMSpriteMask._targetPosition
protected

◆ _targetScale

Vector3 MoreMountains.Tools.MMSpriteMask._targetScale
protected

◆ AutomaticallySetupParticleSystems

bool MoreMountains.Tools.MMSpriteMask.AutomaticallySetupParticleSystems = true

whether or not all particle systems should be converted

◆ AutomaticallySetupSpriteRenderers

bool MoreMountains.Tools.MMSpriteMask.AutomaticallySetupSpriteRenderers = true

whether or not all sprite renderers should be converted

◆ AutomaticallySetupTilemaps

bool MoreMountains.Tools.MMSpriteMask.AutomaticallySetupTilemaps = true

whether or not all tilemaps should be converted

◆ CatchEvents

bool MoreMountains.Tools.MMSpriteMask.CatchEvents = true

if this is true, this mask will move when catching a sprite mask event

◆ MaskInteraction

SpriteMaskInteraction MoreMountains.Tools.MMSpriteMask.MaskInteraction = SpriteMaskInteraction.VisibleInsideMask

the type of interaction to apply to all renderers

◆ ScaleMultiplier

float MoreMountains.Tools.MMSpriteMask.ScaleMultiplier = 100f

the scale multiplier to apply to the sprite mask

◆ Timescale

Timescales MoreMountains.Tools.MMSpriteMask.Timescale = Timescales.Unscaled

the timescale this mask operates on

Property Documentation

◆ MaskTime

virtual float? MoreMountains.Tools.MMSpriteMask.MaskTime
get

The documentation for this class was generated from the following file: