mirror of
https://github.com/cyberarm/i-mic-fps.git
synced 2025-12-15 15:42:35 +00:00
Added HUD widgets, make Boot and Close use button_up instead of button_down
This commit is contained in:
28
lib/hud/widgets/radar.rb
Normal file
28
lib/hud/widgets/radar.rb
Normal file
@@ -0,0 +1,28 @@
|
||||
class IMICFPS
|
||||
class HUD
|
||||
class RadarWidget < HUD::Widget
|
||||
def setup
|
||||
@size = 256
|
||||
@color = Gosu::Color.new(0x88222222)
|
||||
|
||||
@text = Text.new("RADAR")
|
||||
end
|
||||
|
||||
def draw
|
||||
Gosu.draw_rect(
|
||||
@margin, window.height - (@size + @margin),
|
||||
@size, @size,
|
||||
@color
|
||||
)
|
||||
|
||||
@text.draw
|
||||
end
|
||||
|
||||
def update
|
||||
@text.text = "RADAR: X #{@player.position.x.round(1)} Y #{@player.position.z.round(1)}"
|
||||
@text.x = @margin + @size / 2 - @text.width / 2
|
||||
@text.y = window.height - (@margin + @size)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user