ported from perforce
This commit is contained in:
29
DonkeysAndDroids.Godot/Background.cs
Normal file
29
DonkeysAndDroids.Godot/Background.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
using Godot;
|
||||
|
||||
public partial class Background : Control
|
||||
{
|
||||
public override void _Ready()
|
||||
{
|
||||
var rect = GetNode<ColorRect>("SwirlRect");
|
||||
m_SwirlMaterial = rect.Material as ShaderMaterial;
|
||||
|
||||
m_Particles = GetNode<GpuParticles2D>("DustParticles");
|
||||
m_ParticlesProcess = m_Particles.ProcessMaterial as ParticleProcessMaterial;
|
||||
}
|
||||
|
||||
public override void _Process(double delta)
|
||||
{
|
||||
m_Particles.Position = Size / 2;
|
||||
((ParticleProcessMaterial)m_Particles.ProcessMaterial).EmissionBoxExtents = new(Size.X / 2, Size.Y / 2, 1);
|
||||
Refresh();
|
||||
}
|
||||
|
||||
public void Refresh()
|
||||
{
|
||||
}
|
||||
|
||||
private GpuParticles2D m_Particles;
|
||||
private ParticleProcessMaterial m_ParticlesProcess;
|
||||
|
||||
private ShaderMaterial m_SwirlMaterial;
|
||||
}
|
||||
Reference in New Issue
Block a user