Skip to content

BackgroundData Resource

Namespace: SpaceUsurper

Configures a background layer of randomly positioned sprites.

Inheritance: ObjectHotloadedData → BackgroundData

Note

This resource type supports #include, so it can inherit properties from other resources of the same type.

Properties

Name Description
#include (Inherited from HotloadedData<BackgroundData>)
bakedPixelsPerUnit How many rows / columns of pixels per 1x1 area of world space when baking to a texture. TODO: Currently ignored
bakedWorldSize Width / height of area to bake to a texture in world space. Main purpose is to control how soon the texture repeats / tiles. Tune to be as small as possible without seeing noticeable tiling.
bakeToTexture If true, flatten all elements into a texture after spawning, that will be updated as a single element.
precacheTextures (Inherited from HotloadedData<BackgroundData>)
shaderFlags Flags to enable in the ShapeInstanced shader for elements of this background.
spawnAngle Evaluated when an element spawns to decide its starting angle in degrees.
spawnBlinkPeriodA Evaluated when an element spawns to decide its starting channel A color blink period.
spawnBlinkPeriodB Evaluated when an element spawns to decide its starting channel B color blink period.
spawnBlinkPeriodC Evaluated when an element spawns to decide its starting channel C color blink period.
spawnBounds The area in which to spawn elements. If not specified, will use the current stage bounds.
spawnColor1 Evaluated when an element spawns to decide its starting default color for all channels. Overridden by etc.
spawnColor2 Evaluated when an element spawns to decide its starting blink color for all channels. Overridden by etc.
spawnColorA1 Evaluated when an element spawns to decide its starting channel A default color. (Default: white)
spawnColorA2 Evaluated when an element spawns to decide its starting channel A blink color. (Default: spawnColorA1)
spawnColorB1 Evaluated when an element spawns to decide its starting channel B default color. (Default: clear)
spawnColorB2 Evaluated when an element spawns to decide its starting channel B blink color. (Default: spawnColorB1)
spawnColorC1 Evaluated when an element spawns to decide its starting channel C default color. (Default: clear)
spawnColorC2 Evaluated when an element spawns to decide its starting channel C blink color. (Default: spawnColorC1)
spawnDepthLevel Depth level for this background layer.
spawnExtraFrameSize Evaluated when an element spawns to decide its starting extra frame size.
spawnFloatVar Initial value of an auxiliary float var shared by all elements.
spawnGlow Evaluated when an element spawns to decide its starting glow for all channels. Overridden by etc.
spawnGlowA Evaluated when an element spawns to decide its starting channel A glow.
spawnGlowB Evaluated when an element spawns to decide its starting channel B glow.
spawnGlowC Evaluated when an element spawns to decide its starting channel C glow.
spawnOpacity Evaluated when an element spawns to decide its starting opacity. (Default: 1.0)
spawnParallax Evaluated when an element spawns to decide its starting parallax multiplier.
spawnPositionVariance Value between 0 and 1 to decide how much to randomize element spawn positions.
spawnRadius Evaluated when an element spawns to decide its starting radius. (Default: 1.0)
spawnRotateChannels Only evaluated when is true. Value modulo 3: 0: RGB -> RGB (no effect) 1: RGB -> GBR 2: RGB -> BRG
spawnSpacing Elements will be spawned in a grid with this average horizontal / vertical spacing. If not specified / zero, will spawn only one element.
spawnSpriteIndex Index into , evaluated when each element spawns.
spawnSprites List of all possible sprite paths.
subLayers
updateAngle Evaluated when an element updates to decide its current angle in degrees.
updateBlinkPeriodA Evaluated when an element updates to decide its current channel A color blink period.
updateBlinkPeriodB Evaluated when an element updates to decide its current channel B color blink period.
updateBlinkPeriodC Evaluated when an element updates to decide its current channel C color blink period.
updateColor1 Evaluated when an element updates to decide its current default color for all channels. Overridden by etc.
updateColor2 Evaluated when an element updates to decide its current blink color for all channels. Overridden by etc.
updateColorA1 Evaluated when an element updates to decide its current channel A default color.
updateColorA2 Evaluated when an element updates to decide its current channel A blink color.
updateColorB1 Evaluated when an element updates to decide its current channel B default color.
updateColorB2 Evaluated when an element updates to decide its current channel B blink color.
updateColorC1 Evaluated when an element updates to decide its current channel C default color.
updateColorC2 Evaluated when an element updates to decide its current channel C blink color.
updateFloatVar Current value of an auxiliary float var shared by all elements.
updateGlow Evaluated when an element updates to decide its current glow for all channels. Overridden by etc.
updateGlowA Evaluated when an element updates to decide its current channel A glow.
updateGlowB Evaluated when an element updates to decide its current channel B glow.
updateGlowC Evaluated when an element updates to decide its current channel C glow.
updateOpacity Evaluated when an element updates to decide its current opacity.
updateRadius Evaluated when an element updates to decide its current radius.
useSpriteAsBakedTexture If true, use the first sprite in as the baked texture for this background layer. This is an alternative to , that will still use to render the same image multiple times with different properties.

Script Parameters

Note

These parameters are available for you to use while writing scripts inside of a resource of this type.

Name Description
background Type: Background
campaignIndex The stage's index in the campaign.
Type: Int32
currSpawnPos Type: Vector2
dt In-game time since the last update (1/60s), modified by timescale.
Type: Single
dtRaw In-game time since the last update (1/60s), unaffected by timescale changes.
Type: Single
elapsedTime Type: Single
element Type: IBackgroundElement
floatVar Type: Single
player Type: Player
players List of all players.
Type: Player[]
rand Type: Rand
ropeCurrLength Type: Single
ropeNumSprings Type: Int32
ropeSpringNum Type: Int32
ropeTotalLength Type: Single
stage The currently playing stage.
Type: GameStage
stageHeight The height of the arena.
Type: Single
stagePath The location of this stage's config data.
Type: String
stageSize The size of the arena.
Type: Vector2
stageTime The elapsed time for the current run.
Type: Single
stageWidth The width of the arena.
Type: Single
this Type: Background
xMax The right boundary of the arena.
Type: Single
xMin The left boundary of the arena.
Type: Single
yMax The upper boundary of the arena.
Type: Single
yMin The lower boundary of the arena.
Type: Single
$version Alias of stage.GetScriptVersion(FILE)
Type: Int32
averageMoveInputPercent Alias of stage.PlayerHandler.AverageMoveInputPercent
Type: Single
averagePlayerPos Alias of stage.AveragePlayerPos
Type: Vector2
averagePlayerVel Alias of stage.AveragePlayerVel
Type: Vector2
averageShootInputPercent Alias of stage.PlayerHandler.AverageShootInputPercent
Type: Single
debugToggle Alias of stage.MiscDebugToggle
Type: Boolean
difficulty Alias of stage.Difficulty
Type: Single
diffInt Alias of stage.DifficultyInt
Type: Int32
isDocked Alias of stage.IsDocked
Type: Boolean
isGameOver Alias of stage.IsGameOver
Type: Boolean
isPaused Alias of stage.IsPaused
Type: Boolean
isPlayerCollidingWithPixel Alias of player.IsCollidingWithPixel
Type: Boolean
isSwitch Alias of stage.IsSwitch
Type: Boolean
maxPlayerInvulnPercent Alias of stage.MaxPlayerInvulnPercent
Type: Single
numAlivePlayers Alias of stage.AlivePlayerCount
Type: Int32
numPlayers Alias of stage.PlayerCount
Type: Int32
numShotPatterns Alias of stage.NumShotPatterns
Type: Int32
numSpawnedPatterns Alias of stage.NumSpawnedPatterns
Type: Int32
numUnits Alias of stage.UnitHandler.NumActiveUnits
Type: Int32
PI Alias of 3.141593
Type: Single
playerAimAngle Alias of player.Input.AimAngle
Type: Single
playerAimDir Alias of player.Input.AimDirection
Type: Vector2
playerAimInputPercent Alias of player.Input.AimInputPercent
Type: Single
playerAimVector Alias of player.Input.AimVector
Type: Vector2
playerBodyColorA Alias of player.Body.BodyColorA
Type: Color
playerBodyColorB Alias of player.Body.BodyColorB
Type: Color
playerBodyColorC Alias of player.Body.BodyColorC
Type: Color
playerBodyOpacity Alias of player.Body.BodyOpacity
Type: Single
playerBodySize Alias of player.Body.Size
Type: Vector2
playerBodyWidthMods Alias of player.Body.WidthMods
Type: Vector2
playerBoostPercent Alias of player.BoostPercent
Type: Single
playerBrakeInputPercent Alias of player.Input.BrakeInputPercent
Type: Single
playerBrakePercent Alias of player.Body.BrakePercent
Type: Single
playerDamageBonus Alias of player.DamageBonus
Type: Single
playerDeathPercent Alias of player.DeathPercent
Type: Single
playerFacingAngle Alias of player.Body.FacingAngle
Type: Single
playerFacingDir Alias of player.Body.FacingDirection
Type: Vector2
playerGrazePercent Alias of player.Health.GrazePercent
Type: Single
playerGrazePos Alias of player.Health.GrazePos
Type: Vector2
playerGunAngle Alias of player.GunHandler.AimAngle
Type: Single
playerGunDir Alias of player.GunHandler.AimDirection
Type: Vector2
playerGunPos Alias of player.GunHandler.Position
Type: Vector2
playerGunSize Alias of player.GunHandler.Size
Type: Vector2
playerGunWidthMods Alias of player.GunHandler.WidthMods
Type: Vector2
playerIgnoreBulletDamage Alias of player.IgnoreBulletDamage
Type: Boolean
playerIgnoreLaserDamage Alias of player.IgnoreLaserDamage
Type: Boolean
playerInvulnPercent Alias of player.Health.InvulnPercent
Type: Single
playerIsDead Alias of player.IsDead
Type: Boolean
playerIsDying Alias of player.IsDying
Type: Boolean
playerIsIntangible Alias of player.IsIntangible
Type: Boolean
playerIsInvuln Alias of player.Health.IsInvulnerable
Type: Boolean
playerLastHitBullet Alias of player.Health.BulletDamageSource
Type: DataPath<BulletData>
playerLastHitSourceIsBullet Alias of player.Health.PlayerLastDamageSourceIsBullet
Type: Boolean
playerLastHitUnit Alias of player.Health.UnitDamageSource
Type: DataPath<UnitData>
playerLastPos Alias of player.Movement.LastPos
Type: Vector2
playerLastStatusActivated Alias of player.StatusEffectHandler.LastStatusActivatedPath
Type: DataPath<StatusEffectData>
playerLastStatusLevelChangedAmount Alias of player.StatusEffectHandler.LastStatusLevelChangedAmount
Type: Int32
playerLastStatusLevelChangedPath Alias of player.StatusEffectHandler.LastStatusLevelChangedPath
Type: DataPath<StatusEffectData>
playerMoveDelta Alias of player.Movement.MoveDelta
Type: Vector2
playerMoveInputPercent Alias of player.Input.MoveInputPercent
Type: Single
playerMoveVector Alias of player.Input.MoveVector
Type: Vector2
playerNumTimesPreventedDeath Alias of player.Health.NumTimesPreventedDeath
Type: Int32
playerPixelLastCollisionTime Alias of player.LastPixelCollisionTime
Type: Single
playerPos Alias of player.Movement.Position
Type: Vector2
playerRecoilPercent Alias of player.GunHandler.MaxRecoilPercent
Type: Single
playerSelectedStatusPath Alias of player.StatusEffectHandler.SelectedStatusPath
Type: DataPath<StatusEffectData>
playerShootInputPercent Alias of player.Input.ShootInputPercent
Type: Single
playerVel Alias of player.Movement.Velocity
Type: Vector2
playerVelPercent Alias of player.Movement.VelocityPercent
Type: Single
rawStageTime Alias of stage.RawFixedElapsedTime
Type: Single
song Alias of stage.SongHandler.Song
Type: Song
stageBaseBgColor Alias of stage.BaseBgColor
Type: Color
stageBgColor Alias of stage.BgColor
Type: Color
stageBounds Alias of stage.Bounds
Type: Rect
stageCenter Alias of stage.BoundsCenter
Type: Vector2
stageProgress Alias of stage.ScoringHandler.Progress
Type: Single
stageState Alias of stage.BehaviourHandler.CurrentState
Type: String
timeScale Alias of stage.TimeScaleHandler.CurrentTimeScale
Type: Single