Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Gifs

edited June 2014 in General Posts: 24

Hi guys it there any way that I can use gifs I have tried this code and it only uses this first image of the gif soooooo is there any way that I can use

-- Downloading an image
function setup()
logoImage = nil

-- Request some data
http.request( 'http://twolivesleft.com/logo.png',
              didGetImage )

end

-- Our callback function
function didGetImage( theImage, status, head )
logoImage = theImage
end

function draw()
background(20,20,40)
if logoImage ~= nil then
sprite(logoImage, WIDTH/2,HEIGHT/2,WIDTH)
end
end

Tagged:

Comments

  • Posts: 1,595

    Hello @Dantheman2001, you can't use GIFs as far as I'm aware but you can use sprite sheets. If you don't know what a sprite sheet is imagine all the frames you have in your GIF laid out on one big image. You only show a section of that big image and move the big image around to show each different frame through that section. Have a search around the forums there are some great examples and some pre-built functions for creating/reading sprite sheets that users have made.

  • dave1707dave1707 Mod
    Posts: 7,155

    @IlikeMc Stay on topic or you, your discussions and comments will be removed. No more warnings.

  • Posts: 239

    @dave1707 he's probebly 9 or 10

  • dave1707dave1707 Mod
    Posts: 7,155

    @kirorp He's gone.

Sign In or Register to comment.