Tutorial 3 is ok?
Posted: Wed Apr 01, 2009 12:29 pm
I coded the tutorial 3 and I believe that it didn't do all that I suppose that it do.
and....
Nice to meet you all.
and....
Nice to meet you all.
outputfunction load()
font = love.graphics.newFont (love.default_font, 14)
love.graphics.setFont (font)
end
function draw()
love.graphics.draw("A really long sentence whitch will probably be broken into many ieces by my love.", 500,100,250, love.align_right)
love.graphics.draw("This text will be centered no matter what.\n(and you LOVE it)", 0, 400,800, love.align_center)
love.graphics.draw("Aligned to the left, yer very much so",100, 500,150)
end
Code: Select all
-- Tutorial: Fonts and Text
-- Adding font objects and drawing some text.
function load()
defaultfont = love.graphics.newFont(love.default_font, 14)
fontfile = love.graphics.newFont("LOTR.TTF", 14)
imagefont = love.graphics.newImageFont("imagefont.png", " abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.,!?-+/():;%&`'*#=[]\"")
love.graphics.setFont(defaultfont) -- change the font in here to see the changes
love.graphics.setColor(255,255,255,255) -- we need to set a color as well
num = 15
end
function draw()
love.graphics.draw("This is some awesome text", 100, 100) -- drawn at the position (100,100)
love.graphics.draw(num, 100, 150)
love.graphics.draw("This is the first line\nThis is the second one.\n(and a third)\n\nfifth", 100, 200)
love.graphics.drawf("A really long sentence which will probably be broken into many pieces by my love.", 500, 100, 250, love.align_right)
love.graphics.drawf("This text will be centered no matter what!\n(and you LOVE it)", 0, 400, 800, love.align_center)
love.graphics.drawf("Aligned to the left, yes very much so.", 100, 500, 150)
end