Page 1 of 3
move to the points of graphic
Posted: Wed Jan 12, 2022 8:57 pm
by Samuele
hi, i've encountered a minor problem when livecode runs this script
Code: Select all
on GameOver
show image "GameOverSign"
move image "GameOverSign" to the points of graphic "Curve" in 3 seconds without waiting
show graphic "GrayThing"
show field "RestartInfo"
end GameOver
it shows it in fragments and not clear is there a better way? thanks.
and another question, how can i make something happen after the image finishes the 'path'?
Re: move to the points of graphic
Posted: Wed Jan 12, 2022 9:06 pm
by richmond62
How about inserting something like this into your script:
set the visible of image "GameIsFinished" to true
Code: Select all
on GameOver
show image "GameOverSign"
move image "GameOverSign" to the points of graphic "Curve" in 3 seconds without waiting
show graphic "GrayThing"
show field "RestartInfo"
wait 3 secs
set the vis of image "GameIsFinished" to true
end GameOver
Re: move to the points of graphic
Posted: Wed Jan 12, 2022 9:56 pm
by dunbarx
Hi.
How many points are there in grc "Curve? I assume not hundreds.
If you specify three seconds, and there are only handfuls or so of points, you must understand that LC is merely following your instructions. To smooth out the action, you must increase the number of points in the graphic, possibly dramatically. Can you do this?
Craig.
Re: move to the points of graphic
Posted: Fri Jan 14, 2022 2:45 am
by Samuele
dunbarx wrote: ↑Wed Jan 12, 2022 9:56 pm
How many points are there in grc "Curve? I assume not hundreds.
i don't know but from this screenshot

- Immagine 2022-01-14 024005.png (3.86 KiB) Viewed 6000 times
yo can see that the silidebar is small so it goes down a lot, the strange thing is that the problem has arisen only recently and for example before it wasn't there.
thanks
Re: move to the points of graphic
Posted: Fri Jan 14, 2022 5:26 am
by dunbarx
Looks like a fair number of points. Ask:
Code: Select all
answer the number of lines of the points of grc "curve"
Craig
Re: move to the points of graphic
Posted: Sun Jan 16, 2022 2:30 pm
by Samuele
Hi, the aswer that came up is "395".
Thanks.
Re: move to the points of graphic
Posted: Sun Jan 16, 2022 3:04 pm
by richmond62
it shows it in fragments
Do you mean that you cannot see the image as it moves properly?
Re: move to the points of graphic
Posted: Sun Jan 16, 2022 3:58 pm
by richmond62
-
Well, I had some fun today.
630 points.
Re: move to the points of graphic
Posted: Sun Jan 16, 2022 5:29 pm
by Samuele
Ok, so that's exactly my script but it doesn't do like that (well a few weeks ago, yes, but then I changed something and now it's weird). it's like livecode shows the image that i want to move to the points of the graphic then the moving stops and livecode hides the image then reshow it and move to the points of the graphic. all of this pretty fast, i checke for hide ans show scripts but i didn't find any relation to this script...
Re: move to the points of graphic
Posted: Sun Jan 16, 2022 5:39 pm
by richmond62
If you want to you can either post your stack here, or, if you want it to be private,
you can send it to me as a private message and I can have a look at it.
Re: move to the points of graphic
Posted: Sun Jan 16, 2022 6:13 pm
by Samuele
In the meantime i think the problem is in this code but i can't quite understand where.
Code: Select all
else if field "timer" = 0
then
GameOver
aeStopMoving "all"
DisableObjects
show button "Restart" with visual effect dissolve very fast
show widget "Info"
show widget "Home"
show widget "Settings"
HighScore
HideBonuses
end if
end ActivateTimer
Code: Select all
on GameOver
show image "GameOverSign"
move image "GameOverSign" to the points of graphic "Curve" in 3 seconds without waiting
show graphic "GrayThing"
show field "RestartInfo"
end GameOver
Thanks!
Re: move to the points of graphic
Posted: Sun Jan 16, 2022 6:39 pm
by Klaus
Buonasera Samuele,
I think the "visual effect" kills your "moving".
Comment that line out or leave the effect out and see if that works as exspected:
Code: Select all
else if field "timer" = 0
then
GameOver
aeStopMoving "all"
DisableObjects
## show button "Restart" with visual effect dissolve very fast
show button "Restart"
show widget "Info"
show widget "Home"
show widget "Settings"
HighScore
HideBonuses
end if
end ActivateTimer
If it works then the visual effect is the problem.
Remember that LC is very fast, so all this:
Code: Select all
...
GameOver ## including the moving image!
aeStopMoving "all"
DisableObjects
...
will take a millisecond or less, so LC will try to let the visual effect happen at the same time
as moving the image and that does not work since visual effects will always lock the screen!
Code: Select all
-> show button "Restart" with visual effect dissolve very fast
Obviously we cannot have both...
Best
Klaus
Re: move to the points of graphic
Posted: Sun Jan 16, 2022 6:54 pm
by Samuele
allright, thanks, i tried without the visual effect and it doesn't solve the problem entirely, it's only faster but the problem remains.
thanks
Re: move to the points of graphic
Posted: Sun Jan 16, 2022 7:45 pm
by Klaus
OK, as othe already said, there may be just too many points in the graphic, try to reduce them.
From your screenshot you could e.g. remove coublettes
And you will not need every pixel so you could remove some steps.
Instead of:
Code: Select all
...
159,9
159,10
...
159,15
159,16
...
Use:
and not every pixel in beetween!
That way your movement will be much smoother, which is you current problem, right?
Re: move to the points of graphic
Posted: Sun Jan 16, 2022 7:48 pm
by richmond62
coublettes
Um; 'doublets' ?