How would I go about trying to make my numbers look like my words do? I’m making very specific looking fonts in my game, and it looks weird that the numbers don’t match the letters. I know I would have to make every number that could be scene in my game, but I don’t know how I would add them. Also I have a timer and a score, how would I set those so they would be in the created font as well? Thanks for any help you could give me!
How are you populating your “numbers”? It sounds like you’re using image files (or something else) for them. It is possible to use the newText API to create a text object for any numeric value, which would allow you to control the font in which that object is rendered.
If you are doing this, and you’re still not seeing the right font/style, post the corresponding code and we can take a peek.
Right now this is what I’m using for my timer.
– timer
local timeLimit = 30
local timeLeft = display.newText(timeLimit, 120, -20, native.systemFont, 30)
sceneGroup:insert(timeLeft)
timeLeft:setFillColor(0,0,0)
local function timerdown()
timeLimit = timeLimit-1
timeLeft.text = timeLimit
if(timeLimit ==0) then composer.gotoScene(“end”)
end
end
gametimer = timer.performWithDelay(1000, timerdown, timeLimit)
What I want to do, is make the numbers a font that I would make in inkscape, and save as a picture. Although honestly I really don’t know how to do that.
well, you’re already using the method I was suggesting. The “native.systemFont” bit from the newText object handles which font is used for that text object. Here’s a link to Corona’s guide for using custom fonts:
http://docs.coronalabs.com/guide/system/customFont/index.html
I can’t help with creating your own fonts, but openfontlibrary.org and dafont.com have open licenses for some fonts. Also, here’s a forum post detailing bitmap font usage:
http://forums.coronalabs.com/topic/52906-bitmap-font-for-corona-sdk-with-dynamic-font-selection
Ok thanks for that, that’s basically what I was looking for.
How are you populating your “numbers”? It sounds like you’re using image files (or something else) for them. It is possible to use the newText API to create a text object for any numeric value, which would allow you to control the font in which that object is rendered.
If you are doing this, and you’re still not seeing the right font/style, post the corresponding code and we can take a peek.
Right now this is what I’m using for my timer.
– timer
local timeLimit = 30
local timeLeft = display.newText(timeLimit, 120, -20, native.systemFont, 30)
sceneGroup:insert(timeLeft)
timeLeft:setFillColor(0,0,0)
local function timerdown()
timeLimit = timeLimit-1
timeLeft.text = timeLimit
if(timeLimit ==0) then composer.gotoScene(“end”)
end
end
gametimer = timer.performWithDelay(1000, timerdown, timeLimit)
What I want to do, is make the numbers a font that I would make in inkscape, and save as a picture. Although honestly I really don’t know how to do that.
well, you’re already using the method I was suggesting. The “native.systemFont” bit from the newText object handles which font is used for that text object. Here’s a link to Corona’s guide for using custom fonts:
http://docs.coronalabs.com/guide/system/customFont/index.html
I can’t help with creating your own fonts, but openfontlibrary.org and dafont.com have open licenses for some fonts. Also, here’s a forum post detailing bitmap font usage:
http://forums.coronalabs.com/topic/52906-bitmap-font-for-corona-sdk-with-dynamic-font-selection
Ok thanks for that, that’s basically what I was looking for.