I’m building a game that is going to have multiple drawn level backgrounds (sprites) that change. I was planning on making them retina display size (2048x1536) and quickly discovered they get pretty darn big in file size. I ended up settling for the standard (1024x768) size and after lots of compression I got the images down to about 450k.
My questions are, does an image that size affect the drawing rate of dragging an object by touch around? And if so, is there a way to set up the scene so that the background only has to be drawn once when it is called? And not 60-ish times a second?
I am a graphic designer taking my first crack at coding on my ipad. I’m well aware my coding abilities are not going to be in the best of practices, but I can definitely get things to work… Lol, comparing myself to cargobot, I make a decent 1 star (3 star never enters my mind unless I copy it from YouTube tutorials). Hopefully in the coming months I’ll have something to show for it. I really appreciate the advice and replies!
@notw22 Here’s an example of a full screen background image with 100 sprites that can be dragged around the screen. The average FPS still remains in the high 50’s. I believe that’s what you were asking about.
displayMode(FULLSCREEN)
function setup()
cnt=0
tot=0
tx=WIDTH/2
ty=HEIGHT/2
img=readImage("Cargo Bot:Startup Screen")
end
function draw()
background(40, 40, 50)
fontSize(40)
fill(255,0,0)
sprite(img,WIDTH/2,HEIGHT/2)
for x=-5,4 do
for y=-5,4 do
sprite("Planet Cute:Character Horn Girl",tx+x*50,ty+y*50,70)
end
end
cnt=cnt+1
tot=tot+DeltaTime
text(string.format("AVG FPS %d",cnt/tot),WIDTH/2,HEIGHT-50)
end
function touched(t)
if t.state==MOVING then
tx=t.x
ty=t.y
end
end
@notw22 Anything that is drawn does so at 60 FPS or slower depending on the amount of things on the screen. Dragging an object around the screen shouldn’t slow the display rate down. If you want more info, you can do a forum search ( search bar is on top right side of screen just above “Start a New Discussion”.) There are a couple of years worth of information.
@notw22 Based on what you’re doing, I don’t think there will be any slowdown. It takes a lot of objects being drawn to slow things down enough to notice.