2
2
using Gum . DataTypes ;
3
3
using Gum . DataTypes . Variables ;
4
4
using Gum . Managers ;
5
- using Gum . Wireframe ;
6
5
using Microsoft . Xna . Framework ;
7
6
using MonoGameGum . Forms . Controls ;
8
7
using MonoGameGum . GueDeriving ;
@@ -51,7 +50,7 @@ public OptionsSlider(TextureAtlas atlas)
51
50
background . TextureLeft = backgroundRegion . SourceRectangle . Left ;
52
51
background . TextureTop = backgroundRegion . SourceRectangle . Top ;
53
52
background . TextureWidth = backgroundRegion . Width ;
54
- background . Dock ( Dock . Fill ) ;
53
+ background . Dock ( Gum . Wireframe . Dock . Fill ) ;
55
54
topLevelContainer . AddChild ( background ) ;
56
55
57
56
// Create the title text element
@@ -77,7 +76,7 @@ public OptionsSlider(TextureAtlas atlas)
77
76
78
77
// Create the "OFF" side of the slider (left end)
79
78
NineSliceRuntime offBackground = new NineSliceRuntime ( ) ;
80
- offBackground . Dock ( Dock . Left ) ;
79
+ offBackground . Dock ( Gum . Wireframe . Dock . Left ) ;
81
80
offBackground . Texture = atlas . Texture ;
82
81
offBackground . TextureAddress = TextureAddress . Custom ;
83
82
offBackground . TextureHeight = offBackgroundRegion . Height ;
@@ -86,14 +85,14 @@ public OptionsSlider(TextureAtlas atlas)
86
85
offBackground . TextureWidth = offBackgroundRegion . Width ;
87
86
offBackground . Width = 28f ;
88
87
offBackground . WidthUnits = DimensionUnitType . Absolute ;
89
- offBackground . Dock ( Dock . Left ) ;
88
+ offBackground . Dock ( Gum . Wireframe . Dock . Left ) ;
90
89
innerContainer . AddChild ( offBackground ) ;
91
90
92
91
TextureRegion middleBackgroundRegion = atlas . GetRegion ( "slider-middle-background" ) ;
93
92
94
93
// Create the middle track portion of the slider
95
94
NineSliceRuntime middleBackground = new NineSliceRuntime ( ) ;
96
- middleBackground . Dock ( Dock . FillVertically ) ;
95
+ middleBackground . Dock ( Gum . Wireframe . Dock . FillVertically ) ;
97
96
middleBackground . Texture = middleBackgroundRegion . Texture ;
98
97
middleBackground . TextureAddress = TextureAddress . Custom ;
99
98
middleBackground . TextureHeight = middleBackgroundRegion . Height ;
@@ -102,7 +101,7 @@ public OptionsSlider(TextureAtlas atlas)
102
101
middleBackground . TextureWidth = middleBackgroundRegion . Width ;
103
102
middleBackground . Width = 179f ;
104
103
middleBackground . WidthUnits = DimensionUnitType . Absolute ;
105
- middleBackground . Dock ( Dock . Left ) ;
104
+ middleBackground . Dock ( Gum . Wireframe . Dock . Left ) ;
106
105
middleBackground . X = 27f ;
107
106
innerContainer . AddChild ( middleBackground ) ;
108
107
@@ -118,21 +117,21 @@ public OptionsSlider(TextureAtlas atlas)
118
117
maxBackground . TextureWidth = maxBackgroundRegion . Width ;
119
118
maxBackground . Width = 36f ;
120
119
maxBackground . WidthUnits = DimensionUnitType . Absolute ;
121
- maxBackground . Dock ( Dock . Right ) ;
120
+ maxBackground . Dock ( Gum . Wireframe . Dock . Right ) ;
122
121
innerContainer . AddChild ( maxBackground ) ;
123
122
124
123
// Create the interactive track that responds to clicks
125
124
// The special name "TrackInstance" is required for Slider functionality
126
125
ContainerRuntime trackInstance = new ContainerRuntime ( ) ;
127
126
trackInstance . Name = "TrackInstance" ;
128
- trackInstance . Dock ( Dock . Fill ) ;
127
+ trackInstance . Dock ( Gum . Wireframe . Dock . Fill ) ;
129
128
trackInstance . Height = - 2f ;
130
129
trackInstance . Width = - 2f ;
131
130
middleBackground . AddChild ( trackInstance ) ;
132
131
133
132
// Create the fill rectangle that visually displays the current value
134
133
_fillRectangle = new ColoredRectangleRuntime ( ) ;
135
- _fillRectangle . Dock ( Dock . Left ) ;
134
+ _fillRectangle . Dock ( Gum . Wireframe . Dock . Left ) ;
136
135
_fillRectangle . Width = 90f ; // Default to 90% - will be updated by value changes
137
136
_fillRectangle . WidthUnits = DimensionUnitType . PercentageOfParent ;
138
137
trackInstance . AddChild ( _fillRectangle ) ;
@@ -146,7 +145,7 @@ public OptionsSlider(TextureAtlas atlas)
146
145
offText . FontScale = 0.25f ;
147
146
offText . UseCustomFont = true ;
148
147
offText . Text = "OFF" ;
149
- offText . Anchor ( Anchor . Center ) ;
148
+ offText . Anchor ( Gum . Wireframe . Anchor . Center ) ;
150
149
offBackground . AddChild ( offText ) ;
151
150
152
151
// Add "MAX" text to the right end
@@ -158,7 +157,7 @@ public OptionsSlider(TextureAtlas atlas)
158
157
maxText . FontScale = 0.25f ;
159
158
maxText . UseCustomFont = true ;
160
159
maxText . Text = "MAX" ;
161
- maxText . Anchor ( Anchor . Center ) ;
160
+ maxText . Anchor ( Gum . Wireframe . Anchor . Center ) ;
162
161
maxBackground . AddChild ( maxText ) ;
163
162
164
163
// Define colors for focused and unfocused states
@@ -251,4 +250,4 @@ private void HandleValueChanged(object sender, EventArgs e)
251
250
// _fillRectangle uses percentage width units, so we multiply by 100
252
251
_fillRectangle . Width = 100 * ( float ) ratio ;
253
252
}
254
- }
253
+ }
0 commit comments