how to use background images as background

Hi I just got Codea and I am very new to Lua language. I know HTML, CSS, JavaScript, java, c#, and Visual Basic.
Does anyone know how to code the background image from your photo library instead of background color? thanks

Hi @Kingamer and welcome, this is one way to do it:


function setup()
-- Use Sprite Editor to import photos from your library (tap the highlighted text below)
    img = readImage("Documents:myImportedPhoto")
end

function draw()
    -- spriteMode is CENTER by default
    sprite(img, WIDTH/2, HEIGHT/2, WIDTH, HEIGHT)

-- you could use the image path directly, but loading it into a variable is better.
-- sprite("Documents:myImportedPhoto", WIDTH/2, HEIGHT/2, WIDTH, HEIGHT)

    -- do the rest of your drawing here
end

Please note that there are a lot of nice examples that come with Codea, you should give them a look :wink:

Cheers