mirror of
https://github.com/cyberarm/i-mic-fps.git
synced 2025-12-15 15:42:35 +00:00
Added fonts and tweaked hud, added chat history and score board hud widgets
This commit is contained in:
@@ -2,17 +2,24 @@ class IMICFPS
|
||||
class HUD
|
||||
class RadarWidget < HUD::Widget
|
||||
def setup
|
||||
@size = 256
|
||||
@color = Gosu::Color.new(0x88222222)
|
||||
@size = 288
|
||||
@border_color = Gosu::Color.new(0x88c64600)
|
||||
@radar_color = Gosu::Color.new(0x88212121)
|
||||
|
||||
@text = Text.new("RADAR")
|
||||
@text = Text.new("RADAR", size: 18, mode: :add, font: MONOSPACE_FONT)
|
||||
end
|
||||
|
||||
def draw
|
||||
Gosu.draw_rect(
|
||||
@margin, window.height - (@size + @margin),
|
||||
@size, @size,
|
||||
@color
|
||||
@border_color
|
||||
)
|
||||
|
||||
Gosu.draw_rect(
|
||||
@margin + @padding, window.height - (@size + @margin) + @padding,
|
||||
@size - @padding * 2, @size - @padding * 2,
|
||||
@radar_color
|
||||
)
|
||||
|
||||
@text.draw
|
||||
@@ -21,7 +28,7 @@ class IMICFPS
|
||||
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)
|
||||
@text.y = window.height - (@margin + @size + @text.height)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user