public BackgroundMatcher(ICameraManager cameraManager, TransitionalSpriteRenderer renderer, BackgroundMetadata metadata) : base(cameraManager, updateDelay, renderer) { this.renderer = renderer; this.metadata = metadata; MatchMode = metadata.MatchMode; CustomMatchRatio = metadata.CustomMatchRatio; }
/// <summary> /// Creates the matcher for a background actor with the provided metadata and renderer. /// Will return null in case matcher is not required based on the actor configuration. /// </summary> public static BackgroundMatcher CreateFor(BackgroundMetadata metadata, TransitionalRenderer renderer) { if (renderer is TransitionalSpriteRenderer spriteRenderer && metadata.MatchMode != CameraMatchMode.Disable) { var cameraManager = Engine.GetService <ICameraManager>(); var matcher = new BackgroundMatcher(cameraManager, spriteRenderer, metadata); matcher.Start(); return(matcher); } return(null); }
public GenericBackground(string id, BackgroundMetadata metadata) : base(id, metadata) { }
public SpriteBackground(string id, BackgroundMetadata metadata) : base(id, metadata) { }