how can i draw a sprite

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
TonyDwr
Prole
Posts: 7
Joined: Mon May 10, 2010 9:27 am

how can i draw a sprite

Post by TonyDwr »

I create a spritepatch, and try to draw it , but only show the first picture of the sprite, i want to show the sprite one frame by another frame..
how can i draw a sprite which has a few pictures? I have been tried to used a gif picture that fix all the pictures in,and draw it but there is no effect, and tried to use a picture that your demo used named "planetfont.png" but has no effect too. Can any body can tell me how to do this? I want to draw a consecutive animation(or I call it a sprite tha has bath consecutive pictures).
my english is not good..so.... who can understand and tell me how to use the spritepath. my code:
---------------------------------------------------------------------------------------C o d e----------------------------------------------------------------------------------
function love.load()
boss_one_1 = love.graphics.newImage("planetfont.png")//this picture I want to draw has batch consecutive pictures
boss_one = love.graphics.newSpriteBatch(boss_one_1, 39)
boss_one:add(300, 200, 0, 1, 1, 0, 0)
end

function love.update(dt)
--[[
do sth.
]]
end

function love.draw()

love.graphics.draw(images.bg, 0, 0, 0, 1, 1, 0, 0)

love.graphics.draw(boss_one, 80, 50, 0, 1, 1, 0, 0)//only show the first frame of this sprite

end
--------------------------------------------------------------------------------------
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: how can i draw a sprite

Post by Robin »

Well, it's difficult to tell what you want. Do you want to get an animation from an image? You could use AnAL.
Help us help you: attach a .love.
TonyDwr
Prole
Posts: 7
Joined: Mon May 10, 2010 9:27 am

Re: how can i draw a sprite

Post by TonyDwr »

Yes, thank you very much. my english is not very good. so... thanks very much.
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 3 guests