Hello, I got this code to load my font in addons folder:
[lua]
resource.AddFile("death.ttf")
[/lua]
And this code on my hud:
[lua]
surface.CreateFont("Death18", {
font = "death",
size = 18,
weight = 1000,
antialias = true,
additive = false
})
local function DrawHUD()
surface.SetFont("Death18")
surface.SetTextColor(0, 0, 0, 255)
surface.SetTextPos(5, y - 50)
surface.DrawText("Health")
end
-- Currently i don't want to add numbers, just as test
[/lua]
But font appears normal and more like texts of this page.
In what folder is "death.ttf"?
I made an addon called FontLoader, inside it there's addon.txt and lua folder, inside lua folder my font is on there, and the file which addcsluafiles is on autorun folder.
You don't put font files in the lua folder.
[editline]7th August 2013[/editline]
They go in "garrysmod/resource/fonts"
[QUOTE=EvacX;41743502]You don't put font files in the lua folder.
[editline]7th August 2013[/editline]
They go in "garrysmod/resource/fonts"[/QUOTE]
Thanks, How about resources.AddFile? Is there any need to add it?
resource.AddFile just makes the client download whatever file you want. You'd want to do "resource.AddFile( "resource/fonts/death.ttf" )"
[QUOTE=EvacX;41743515]resource.AddFile just makes the client download whatever file you want. You'd want to do "resource.AddFile( "resource/fonts/death.ttf" )"[/QUOTE]
Thanks, solved.
Sorry, you need to Log In to post a reply to this thread.