lib/engine/font.rb in ruby_rpg-0.0.2 vs lib/engine/font.rb in ruby_rpg-0.0.3
- old
+ new
@@ -13,11 +13,11 @@
end
def texture
@texture ||=
begin
- path = File.expand_path(File.join(ROOT, "_imported", @font_file_path.gsub(".ttf", ".png")))
+ path = File.join("_imported", @font_file_path.gsub(".ttf", ".png"))
Engine::Texture.for(path)
end
end
def vertex_data(string)
@@ -33,10 +33,10 @@
def string_offsets(string)
offsets = []
scale_factor = 1 / (1024.0 * 2)
horizontal_offset = 0.0
vertical_offset = 0.0
- font_path = File.expand_path(File.join(ROOT, "_imported", @font_file_path.gsub(".ttf", ".json")))
+ font_path = File.expand_path(File.join(GAME_DIR, "_imported", @font_file_path.gsub(".ttf", ".json")))
font_metrics = JSON.parse File.read(font_path)
string.chars.each do |char|
if char == "\n"
vertical_offset -= 1.0
horizontal_offset = 0.0