Move Multiple Graphics on Mobile simultaneously

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
istech
Posts: 211
Joined: Thu Sep 19, 2013 10:08 am

Move Multiple Graphics on Mobile simultaneously

Post by istech » Tue Apr 01, 2014 12:09 pm

Hi Livecoders,

Q.1 Just looking for a litle guidance or suggestions. I want to move multiple objects simultaneously on a mobile device but what I get is the first graphic moving and the rest trying to move.
I have attached the code is below, is there any opimisation I can do? Maybe send each move to a separate handler?

Q.2 I have also noticed that if I decide to change cards while a move is in process(even with cancel pending messages in close card) the next command after the move will always execute even though I have changed card. ( I have a "if" in place at the moment as a workaround but what is the proper way to stop a "move" on close card and prevent any other commands from running.)

Thanks All


lock screen
set the lockMoves to true
move img "N9" to the points of grc "N1" in 5 seconds without waiting # works fine
move img "N8" to the points of grc "N2" in 5 seconds without waiting
move img "N7" to the points of grc "N3" in 5 seconds without waiting
move img "N6" to the points of grc "N4" in 5 seconds without waiting
move img "N5" to the points of grc "N5" in 5 seconds without waiting
move img "N4" to the points of grc "N6" in 5 seconds without waiting
move img "N3" to the points of grc "N7" in 5 seconds without waiting
move img "N2" to the points of grc "N8" in 5 seconds without waiting
move img "N1" to the points of grc "N9" in 5 seconds without waiting
set the lockMoves to false
unlock screen

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10333
Joined: Wed May 06, 2009 2:28 pm

Re: Move Multiple Graphics on Mobile simultaneously

Post by dunbarx » Tue Apr 01, 2014 4:40 pm

Hi.

This works fine for me in the IDE. Does it for you as well? Is it only in the mobil standalone that you have problems? Just for compactness, I did:

Code: Select all

on mouseUp
   repeat with y = 1 to 10
      move btn y to the points of grc y in 5 seconds without waiting
   end repeat
   end mouseUp
Craig Newman

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Move Multiple Graphics on Mobile simultaneously

Post by Klaus » Tue Apr 01, 2014 4:46 pm

Hi istech,

the syntax looks correct, maybe you should remove the "un-/lock screen" part.


Best

Klaus

istech
Posts: 211
Joined: Thu Sep 19, 2013 10:08 am

Re: Move Multiple Graphics on Mobile simultaneously

Post by istech » Tue Apr 01, 2014 5:02 pm

Thanks for the reply.

The code works fine in IDE just not mobile. I think it is processing power, or lack there of.

I will give the repeat a go and report back..

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Move Multiple Graphics on Mobile simultaneously

Post by Klaus » Tue Apr 01, 2014 5:54 pm

istech wrote:The code works fine in IDE just not mobile. I think it is processing power, or lack there of.
That is very possible!

I have a project that I need to completely modify to run on Android at all!
Lots of "move"ing stuff etc. and it just won't run even on decent Android hardware 8)

CHEAP-O! :D

istech
Posts: 211
Joined: Thu Sep 19, 2013 10:08 am

Re: Move Multiple Graphics on Mobile simultaneously

Post by istech » Tue Apr 01, 2014 11:19 pm

The repeat makes little difference.

interesting that on a ipad all is good.

Android not so much.

My Android is quite high spec. So not sure what the problem could be other than CPU performance issues.

I will try a couple workarounds and see how it goes.

Post Reply