You can't just set them to the same variable like that. Once it loses its reference, the windows will eventually be freed. In this case, they won't ever even show up since you don't update Graphics before freeing them.
So, you could do something like:
def create_gauge_window
if !VP::VAR::VARIABLE.empty?
@gauge_windows = []
for x in VP::VAR::VARIABLE
@gauge_windows.push(Gauge_Hud.new(20))
end
end
end
If you are using VX Ace, doing it that way will necesitate that you manually update and dispose the windows. If you wanted to take advantage of the methods already built for that, you would need to give each window its own instance variable. In that case, you could do something like this:
def create_gauge_window
if !VP::VAR::VARIABLE.empty?
for i in 0...VP::VAR::VARIABLE.size
set_instance_variable(:"@gauge_window_#{i+1}", Gauge_Hud.new(20))
end
end
end
If you did that, the windows would be named @gauge_window_1, @gauge_window_2, @gauge_window_3. If you need to reference them, it would probably be wise to also put them inside an array so that you know how to get to them.
I also share Mango's concern about your y-axis being the same, but I also don't see what you're trying to do in that regard so I left that the same. There's no way you can fit 10, 12, or 15 of those windows in that resolution. You'd need between 600 and 900 vertical resolution. That said, you also need to fix that, as with either code I gave you, all the gauges would show up on top of each other.
Also, there's no reason to check if the array is empty if you are just iterating through the array anyway. Nothing will happen if it's empty.
Also, shouldn't there be some importance to the numbers in that array? You don't pass them to the gauge window at all.