Background images.

46 views
Skip to first unread message

Simon Meredith

unread,
Dec 4, 2012, 5:47:34 PM12/4/12
to libzo...@googlegroups.com
I have literally just started using Zoetrope and have never coded anything like this before.

I'm following the tutorials on the site, but I am just wondering how to set a background image?

Thanks!

Chris Klimas

unread,
Dec 4, 2012, 9:31:04 PM12/4/12
to libzo...@googlegroups.com
The easiest way to do it would be to write

self:add(Tile:new{ image = 'mybackground.png' })

Right at the beginning of your app's onRun method. If you leave out an x or y position, Zoetrope assumes you mean 0. And when you leave off a width and height, a Tile automatically sets itself to the dimensions of the source image. Since you do it before you add anything else to the display list, everything else will appear on top of it -- Zoetrope works on the basis of last-added, first-drawn.

chris
Reply all
Reply to author
Forward
0 new messages