Connect TileWorld size with WorldGenerator UI.
parent
ed29cc1288
commit
a40d0aa60b
|
@ -75,6 +75,10 @@ public class Game : Spatial
|
||||||
_camera = (Camera)FindNode("Camera");
|
_camera = (Camera)FindNode("Camera");
|
||||||
_cameraOffset = _camera.GlobalTranslation - _player.GlobalTranslation;
|
_cameraOffset = _camera.GlobalTranslation - _player.GlobalTranslation;
|
||||||
|
|
||||||
|
// populate UI values
|
||||||
|
Slider generatorWorldSizeSlider = worldGeneratorContainer.GetNode<Slider>("HBoxContainer/WorldSizeSlider");
|
||||||
|
generatorWorldSizeSlider.Value = _tileWorld.Size;
|
||||||
|
|
||||||
Debug.Assert(_tileWorld != null);
|
Debug.Assert(_tileWorld != null);
|
||||||
|
|
||||||
// resources
|
// resources
|
||||||
|
|
|
@ -44,6 +44,7 @@ visible = false
|
||||||
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.1, 0 )
|
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.1, 0 )
|
||||||
|
|
||||||
[node name="TileWorld" parent="." instance=ExtResource( 8 )]
|
[node name="TileWorld" parent="." instance=ExtResource( 8 )]
|
||||||
|
Size = 32
|
||||||
|
|
||||||
[node name="DebugContainer" type="PanelContainer" parent="."]
|
[node name="DebugContainer" type="PanelContainer" parent="."]
|
||||||
visible = false
|
visible = false
|
||||||
|
|
|
@ -21,7 +21,7 @@ public class TileWorld : Spatial
|
||||||
delegate void WorldGenerated();
|
delegate void WorldGenerated();
|
||||||
|
|
||||||
// public members
|
// public members
|
||||||
public int Size = 11;
|
[Export] public int Size = 64;
|
||||||
public float HeightScale = 2.0f;
|
public float HeightScale = 2.0f;
|
||||||
public Image Heightmap;
|
public Image Heightmap;
|
||||||
public Image Colormap;
|
public Image Colormap;
|
||||||
|
|
Loading…
Reference in New Issue