Repeat image or use whole image

Hi peps quick question, I come from a web dev background, will using a repeating image e.g. a 960 x 20 gradient repeated yield better results than a 960 x 640 image, take into account that this image could be used within a scrolling background.

How does texture memory handle multiples of the same image on screen? [import]uid: 118379 topic_id: 21948 reply_id: 321948[/import]

It will yield better results as far as texture memory is concerned, yes.

[lua]local function monitorMem(event)
collectgarbage(“collect”)

print( “\nMemUsage: " … (collectgarbage(“count”)/1000) … " MB”)
print("Texture Usage " … system.getInfo( “textureMemoryUsed” ) / 1000000)

return true
end

Runtime:addEventListener(“enterFrame”, monitorMem)[/lua]

That function is handy for comparisons - note the difference between a large image and a small one repeated a number of times.

Peach :slight_smile: [import]uid: 52491 topic_id: 21948 reply_id: 87263[/import]