mirror of
https://github.com/cyberarm/i-mic-fps.git
synced 2025-12-13 06:42:35 +00:00
Replaced usages of Text shadow with properly named border, use new correct Text shadow for menu titles, use text border for a few more elements
This commit is contained in:
@@ -4,7 +4,7 @@ class IMICFPS
|
||||
class HUD
|
||||
class AmmoWidget < HUD::Widget
|
||||
def setup
|
||||
@text = Text.new("", size: 64, font: MONOSPACE_FONT, shadow: true, shadow_color: Gosu::Color::BLACK)
|
||||
@text = Text.new("", size: 64, font: MONOSPACE_FONT, border: true, border_color: Gosu::Color::BLACK)
|
||||
@background = Gosu::Color.new(0x88c64600)
|
||||
end
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ class IMICFPS
|
||||
"",
|
||||
size: 16,
|
||||
x: Widget.margin, y: Widget.margin, z: 45,
|
||||
shadow_color: Gosu::Color::BLACK,
|
||||
border_color: Gosu::Color::BLACK,
|
||||
font: BOLD_SANS_FONT
|
||||
)
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ class IMICFPS
|
||||
class HealthWidget < HUD::Widget
|
||||
def setup
|
||||
@spacer = 0
|
||||
@text = Text.new("", font: MONOSPACE_FONT, shadow: true, shadow_color: Gosu::Color::BLACK)
|
||||
@text = Text.new("", font: MONOSPACE_FONT, border: true, border_color: Gosu::Color::BLACK)
|
||||
@width = 512
|
||||
@height = 24
|
||||
@slant = 32
|
||||
|
||||
@@ -12,7 +12,7 @@ class IMICFPS
|
||||
@border_color = Gosu::Color.new(0x88c64600)
|
||||
@radar_color = Gosu::Color.new(0x88212121)
|
||||
|
||||
@text = Text.new("RADAR", size: 18, font: MONOSPACE_FONT, shadow: true, shadow_color: Gosu::Color::BLACK)
|
||||
@text = Text.new("RADAR", size: 18, font: MONOSPACE_FONT, border: true, border_color: Gosu::Color::BLACK)
|
||||
@image = Gosu::Image.new("#{CYBERARM_ENGINE_ROOT_PATH}/assets/textures/default.png", retro: true)
|
||||
@scale = (@size - Widget.padding * 2.0) / @image.width
|
||||
end
|
||||
|
||||
@@ -10,8 +10,8 @@ class IMICFPS
|
||||
"",
|
||||
size: 16,
|
||||
x: Widget.margin, y: Widget.margin, z: 45,
|
||||
shadow: true,
|
||||
shadow_color: Gosu::Color::BLACK,
|
||||
border: true,
|
||||
border_color: Gosu::Color::BLACK,
|
||||
font: BOLD_SANS_FONT
|
||||
)
|
||||
|
||||
|
||||
@@ -16,8 +16,8 @@ class IMICFPS
|
||||
size: 18,
|
||||
font: SANS_FONT,
|
||||
color: @color,
|
||||
shadow: true,
|
||||
shadow_color: Gosu::Color::BLACK,
|
||||
border: true,
|
||||
border_color: Gosu::Color::BLACK,
|
||||
)
|
||||
end
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ class IMICFPS
|
||||
Slot = Struct.new(:value, :width)
|
||||
|
||||
def initialize
|
||||
@text = CyberarmEngine::Text.new("", x: 3, y: 3, shadow_color: Gosu::Color::BLACK)
|
||||
@text = CyberarmEngine::Text.new("", x: 3, y: 3, border_color: Gosu::Color::BLACK)
|
||||
@slots = []
|
||||
@space_width = @text.textobject.text_width(" ")
|
||||
end
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
class IMICFPS
|
||||
class Boot < GameState
|
||||
def setup
|
||||
@title = Text.new(IMICFPS::NAME, size: 100, z: 0, color: Gosu::Color.new(0xff000000), shadow: false, font: IMICFPS::BOLD_SANS_FONT)
|
||||
@title = Text.new(IMICFPS::NAME, size: 100, z: 0, color: Gosu::Color.new(0xff000000), border: false, font: IMICFPS::BOLD_SANS_FONT)
|
||||
@logo = get_image("#{IMICFPS::GAME_ROOT_PATH}/static/logo.png")
|
||||
|
||||
@start_time = Gosu.milliseconds
|
||||
@@ -76,8 +76,11 @@ class IMICFPS
|
||||
def update
|
||||
@animators.each(&:update)
|
||||
|
||||
y = window.height / 2 - (@logo.height / 2 + @title.height + 8)
|
||||
y = 0 if y < @title.height
|
||||
|
||||
@title.x = window.width / 2 - @title.width / 2
|
||||
@title.y = (0 - @title.height) + (@title.height * @title_animator.transition)
|
||||
@title.y = (0 - (@title.height * (1 - @title_animator.transition))) + (y * @title_animator.transition)
|
||||
|
||||
push_state(MainMenu) if Gosu.milliseconds - @start_time >= @time_to_live
|
||||
end
|
||||
|
||||
@@ -22,8 +22,8 @@ class IMICFPS
|
||||
@assets = []
|
||||
@asset_index = 0
|
||||
|
||||
add_asset(:model, @map_parser.terrain.package, @map_parser.terrain.name)
|
||||
add_asset(:model, @map_parser.skydome.package, @map_parser.skydome.name)
|
||||
add_asset(:model, @map_parser.terrain.package, @map_parser.terrain.name) if @map_parser.terrain.package
|
||||
add_asset(:model, @map_parser.skydome.package, @map_parser.skydome.name) if @map_parser.skydome.package
|
||||
@map_parser.entities.each do |entity|
|
||||
add_asset(:model, entity.package, entity.name)
|
||||
end
|
||||
|
||||
@@ -24,7 +24,7 @@ class IMICFPS
|
||||
end
|
||||
|
||||
stack(width: 0.5, height: 1.0) do
|
||||
label "Asset Viewer", text_size: 100, font: BOLD_SANS_FONT, width: 1.0, text_align: :center
|
||||
title "Asset Viewer"
|
||||
|
||||
link I18n.t("menus.back"), width: 1.0 do
|
||||
pop_state
|
||||
|
||||
@@ -23,10 +23,10 @@ class IMICFPS
|
||||
@camera = PerspectiveCamera.new(aspect_ratio: window.aspect_ratio, position: Vector.new(0, 1.5, 5), orientation: Vector.forward)
|
||||
@camera_controller = CameraController.new(camera: @camera, entity: nil, mode: :fpv)
|
||||
|
||||
label @manifest.name, text_size: 50, text_shadow: true, text_shadow_color: Gosu::Color::BLACK
|
||||
label @manifest.model, text_shadow: true, text_shadow_color: Gosu::Color::BLACK
|
||||
@camera_position = label "", text_shadow: true, text_shadow_color: Gosu::Color::BLACK
|
||||
@camera_orientation = label "", text_shadow: true, text_shadow_color: Gosu::Color::BLACK
|
||||
label @manifest.name, text_size: 50, text_border: true, text_border_color: Gosu::Color::BLACK
|
||||
label @manifest.model, text_border: true, text_border_color: Gosu::Color::BLACK
|
||||
@camera_position = label "", text_border: true, text_border_color: Gosu::Color::BLACK
|
||||
@camera_orientation = label "", text_border: true, text_border_color: Gosu::Color::BLACK
|
||||
|
||||
button "Back" do
|
||||
pop_state
|
||||
|
||||
@@ -22,14 +22,14 @@ class IMICFPS
|
||||
end
|
||||
|
||||
stack(width: 0.5, height: 1.0) do
|
||||
label "Map Editor", text_size: 100, font: BOLD_SANS_FONT, width: 1.0, text_align: :center
|
||||
title "Map Editor"
|
||||
|
||||
flow width: 1.0 do
|
||||
link I18n.t("menus.back"), width: 0.32 do
|
||||
pop_state
|
||||
end
|
||||
|
||||
button "New Map", width: 1.0, width: 0.64
|
||||
button "New Map", width: 0.64
|
||||
end
|
||||
|
||||
label "Edit Map", width: 1.0, text_align: :center, text_size: 50
|
||||
|
||||
@@ -16,7 +16,9 @@ class IMICFPS
|
||||
@input = Text.new("", x: 4, y: @height - (PADDING * 2), z: Console::Z + 1, font: MONOSPACE_FONT)
|
||||
@input.y -= @input.height
|
||||
|
||||
@history = Text.new("=== #{IMICFPS::NAME} v#{IMICFPS::VERSION} (#{IMICFPS::RELEASE_NAME}) ===\n\n", x: 4, z: Console::Z + 1, font: MONOSPACE_FONT)
|
||||
@history = Text.new(
|
||||
"=== #{IMICFPS::NAME} v#{IMICFPS::VERSION} (#{IMICFPS::RELEASE_NAME}) ===\n\n",
|
||||
x: 4, z: Console::Z + 1, font: MONOSPACE_FONT, border: true, border_color: Gosu::Color::BLACK)
|
||||
update_history_y
|
||||
|
||||
@command_history = []
|
||||
|
||||
@@ -22,7 +22,9 @@ class IMICFPS
|
||||
@accent_color = ACCENT_COLOR
|
||||
window.needs_cursor = true
|
||||
|
||||
@__version_text = CyberarmEngine::Text.new("<b>#{IMICFPS::NAME}</b> v#{IMICFPS::VERSION} (#{IMICFPS::RELEASE_NAME})", font: BOLD_SANS_FONT)
|
||||
@__version_text = CyberarmEngine::Text.new(
|
||||
"<b>#{IMICFPS::NAME}</b> v#{IMICFPS::VERSION} (#{IMICFPS::RELEASE_NAME})",
|
||||
font: BOLD_SANS_FONT, border: true, border_color: Gosu::Color::BLACK)
|
||||
@__version_text.x = window.width - (@__version_text.width + 10)
|
||||
@__version_text.y = window.height - (@__version_text.height + 10)
|
||||
|
||||
@@ -39,7 +41,9 @@ class IMICFPS
|
||||
text_size: 100,
|
||||
color: Gosu::Color::BLACK,
|
||||
text_align: :center,
|
||||
width: 1.0
|
||||
text_shadow: true,
|
||||
text_shadow_size: 4,
|
||||
width: 1.0,
|
||||
},
|
||||
Subtitle: {
|
||||
text_size: 50,
|
||||
@@ -51,10 +55,10 @@ class IMICFPS
|
||||
font: BOLD_SANS_FONT,
|
||||
text_size: 50,
|
||||
text_align: :center,
|
||||
text_shadow: true,
|
||||
text_shadow_size: 2,
|
||||
text_shadow_color: Gosu::Color::BLACK,
|
||||
text_shadow_alpha: 100,
|
||||
text_border: true,
|
||||
text_border_size: 2,
|
||||
text_border_color: Gosu::Color::BLACK,
|
||||
text_border_alpha: 100,
|
||||
color: Gosu::Color.rgb(0, 127, 127),
|
||||
width: 1.0,
|
||||
hover: {
|
||||
|
||||
@@ -3,8 +3,7 @@
|
||||
class IMICFPS
|
||||
class ExtrasMenu < Menu
|
||||
def setup
|
||||
title IMICFPS::NAME
|
||||
subtitle "Extras"
|
||||
title I18n.t("menus.extras")
|
||||
|
||||
link "Asset Viewer" do
|
||||
push_state(IMICFPS::AssetViewerTool::MainMenu)
|
||||
|
||||
@@ -4,8 +4,7 @@ class IMICFPS
|
||||
class GamePauseMenu < Menu
|
||||
def setup
|
||||
@bar_alpha = 50
|
||||
title IMICFPS::NAME
|
||||
subtitle "Paused"
|
||||
title "Paused"
|
||||
|
||||
link "Resume" do
|
||||
pop_state
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
class IMICFPS
|
||||
class LevelSelectMenu < Menu
|
||||
def setup
|
||||
title IMICFPS::NAME
|
||||
title I18n.t("menus.singleplayer")
|
||||
subtitle "Choose a Map"
|
||||
|
||||
Dir.glob("#{GAME_ROOT_PATH}/maps/*.json").map { |file| [file, MapParser.new(map_file: file)] }.each do |file, map|
|
||||
|
||||
@@ -3,8 +3,7 @@
|
||||
class IMICFPS
|
||||
class MultiplayerMenu < Menu
|
||||
def setup
|
||||
title IMICFPS::NAME
|
||||
subtitle "Multiplayer"
|
||||
title I18n.t("menus.multiplayer")
|
||||
|
||||
link "Quick Join"
|
||||
link "Server Browser" do
|
||||
|
||||
@@ -8,7 +8,7 @@ class IMICFPS
|
||||
end
|
||||
|
||||
stack(width: 0.5, height: 1.0) do
|
||||
label "Profile", text_size: 100, color: Gosu::Color::BLACK, width: 1.0, text_align: :center
|
||||
title "Profile"
|
||||
|
||||
flow width: 1.0 do
|
||||
link I18n.t("menus.back"), width: 0.32 do
|
||||
|
||||
@@ -36,7 +36,7 @@ class IMICFPS
|
||||
|
||||
stack width: 0.5, height: 1.0 do
|
||||
stack width: 1.0, height: 0.25 do
|
||||
label "Server Browser", text_size: 100, text_align: :center, width: 1.0
|
||||
title "Server Browser"
|
||||
|
||||
flow(width: 1.0) do
|
||||
link I18n.t("menus.back"), width: 0.32 do
|
||||
|
||||
@@ -26,7 +26,7 @@ class IMICFPS
|
||||
|
||||
stack(width: 0.5, height: 1.0) do
|
||||
stack(width: 1.0, height: 0.25) do
|
||||
label "Settings", color: Gosu::Color::BLACK, text_size: 100, text_align: :center, width: 1.0
|
||||
title "Settings"
|
||||
|
||||
flow(width: 1.0) do
|
||||
link I18n.t("menus.back"), width: nil do
|
||||
|
||||
Reference in New Issue
Block a user