Starting with love...

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
marin
Prole
Posts: 1
Joined: Sat Oct 30, 2010 3:17 pm

Starting with love...

Post by marin »

Hi, I need someone to help me ... I'm starting in Love and when I try a simple example made by me, only I get a black window .... I do not understand why?. The main.lua I have :

function load( )
font = love.graphics.newFont( love.default_font, 12 )
love.graphics.setFont( font )
message = " Test "

player=love.graphics.newImage("player.gif")
end

function draw()
love.graphics.draw(message, 100, 100)
love.graphics.draw(player, 100, 100)
end
Gracias....
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Starting with love...

Post by Robin »

That's some rather old syntax. Were did you get that from? This must be 0.5.0 or even older...

Currently, you'll want to use:

Code: Select all

function love.load( )
    font = love.graphics.newFont( 12 )
    love.graphics.setFont( font )
    message = " Test "

    player=love.graphics.newImage("player.gif")
end

function love.draw()
    love.graphics.print(message, 100, 100) --i'm sorry, this shouldn't be draw
    love.graphics.draw(player, 100, 100)
end
Last edited by Robin on Sat Oct 30, 2010 8:46 pm, edited 1 time in total.
Help us help you: attach a .love.
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: Starting with love...

Post by bartbes »

And even you make a mistake:

Code: Select all

function love.load( )
    font = love.graphics.newFont( 12 )
    love.graphics.setFont( font )
    message = " Test "

    player=love.graphics.newImage("player.gif")
end

function love.draw()
    love.graphics.print(message, 100, 100)
    love.graphics.draw(player, 100, 100)
end
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Starting with love...

Post by Robin »

I'm sorry, looked right over it. :oops:
Help us help you: attach a .love.
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 2 guests