Page 1 of 1

App is grindingly slow on iOS

Posted: Fri Jan 03, 2025 8:47 pm
by Aduro91
Hey all,

My app is fine with other cards on iOS but one card is grindingly slow.

It has a gif in the background, which is an image drawn from copy files (resources folder). This shouldnt be a problem because it was already slow when it was entirely failing to source the image from my desktop, before I changed the code for the standalone.

The only other things on the card are a very small gif, some basic graphics, quite a few text fields, one table field with ONE row of information, and two text fields that go up the screen like credits.

This code is the only thing running after some initial work when opening the card:

Code: Select all

on rollcredits
   if the top of field "castnamescredits" < -(field "bonusline" * 17.2) then
      show graphic "bonusindicate"
   else
      hide graphic "bonusindicate"
   end if
   if the bottom of field "castcredits" > 0 then
      set the top of field "castcredits" to the top of field "castcredits" - 1
      set the top of field "castnamescredits" to the top of field "castnamescredits" - 1
      if field "bonuscolourline" < 56 then
         add 1 to field "bonuscolourline"
         set foregroundcolor of line (field "bonusline") of field "castnamescredits" to line (field "bonuscolourline") of field "bonuscolour"
      else
         set foregroundcolor of line (field "bonusline") of field "castnamescredits" to line 1 of field "bonuscolour"
         put 1 into field "bonuscolourline"
      end if
      send rollcredits to me in 40 milliseconds
   end if
end rollcredits
It just moves the text fields and makes a certain line shine, whilst showing people if they have passed a bonus they would need to rewind for.

Any idea why it is a 1 change per second slideshow on iOS when it runs perfectly fine on the desktop Livecode editor and I have done similar apps without this issue?

Re: App is grindingly slow on iOS

Posted: Sat Jan 04, 2025 6:40 pm
by jacque
Almost every command requires a screen redraw which is visually expensive. Try locking the screen at the beginning of the handler and unlocking at the end. Let us know if that isn't enough.

Re: App is grindingly slow on iOS

Posted: Tue Jan 07, 2025 8:24 pm
by Aduro91
Thanks for the advice turns out it was a gif that was much larger than I thought it was! thanks!