SOLVED: gif size

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
kwnz
Posts: 14
Joined: Sun Sep 06, 2020 1:25 am

SOLVED: gif size

Post by kwnz » Sun Sep 06, 2020 1:36 am

Is it possible to make a gif reduce size while moving to points of curve?
The gif is of a walking sheep which moves to the points of a curve (more of a straight line) starting about centre and 2 thirds down of card to bottom right of card.
The purpose is to create a perspective so the sheep gets larger as it nears the front (bottom). Thanks.
I hope I have not been to ambiguous or I see that this could go on for months.
Last edited by kwnz on Mon Sep 07, 2020 10:55 pm, edited 1 time in total.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10099
Joined: Fri Feb 19, 2010 10:17 am

Re: gif size

Post by richmond62 » Sun Sep 06, 2020 1:07 pm

This is entirely possible except if you are doing this sort of thing:

Code: Select all

on mouseUp
move image "ovine.gif" to the points of graphic "sexyCurve"
end mouseUp
HOWEVER, if, instead of doing a "move to the points" thing you move your image to the points (Yup: sounds mental):

First of all:

1. Put the points of your curve into the lines of a listField (or, if you are more clever than me, into an array).

2. Let's call the listField "sexyPoints".

The do this sort of thing:

Code: Select all

on mouseUp
put 1 into KOUNT
repeat until line KOUNT of field "sexyPoints" is empty
move image "ovine.gif" to line KOUNT of field "sexyPoints"
add 1 to KOUNT
------
-- in here you can do something about the size of image "ovine.gif"
------
wait 10 ticks
end repeat
end mouseUp

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10099
Joined: Fri Feb 19, 2010 10:17 am

Re: gif size

Post by richmond62 » Sun Sep 06, 2020 1:44 pm

Screenshot 2020-09-06 at 15.42.31.png
Attachments
Sheep.livecode.zip
Here's the stack
(9.94 KiB) Downloaded 189 times

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10099
Joined: Fri Feb 19, 2010 10:17 am

Re: gif size

Post by richmond62 » Sun Sep 06, 2020 1:59 pm

Although, to be honest, as you want your sheep to travel along a straight line I wouldn't bother with a curve at all:

Code: Select all

on mouseUp
   set the loc of img "ovine.gif" to 100,100
   set the width of img "ovine.gif" to 45
   set the height of img "ovine.gif" to 30
   put 2 into SKALE
   repeat until SKALE > 7
      move img "ovine.gif" to (100 * SKALE, 100 * SKALE)
      set the width of img "ovine.gif" to ((15 * SKALE) + 30)
      set the height of img "ovine.gif" to ((10 * SKALE) + 20)
      wait 4 ticks
      add 1 to SKALE
   end repeat
end mouseUp
-
Screenshot 2020-09-06 at 15.56.39.png
Attachments
Sheep2.livecode.zip
Here's the stack.
(5.71 KiB) Downloaded 201 times

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10099
Joined: Fri Feb 19, 2010 10:17 am

Re: gif size

Post by richmond62 » Sun Sep 06, 2020 2:06 pm

Personally I have always thought that animated GIF images are pretty rubbishy because
they are difficult to control.

For animation I generally split an animated GIF up into its constituent frames and export them as PNG images.
(I always use GIMP for this)

https://www.gimp.org/
-
Screenshot 2020-09-06 at 16.02.21.png
-
Then use them as backGroundPatterns in graphic object rectangles.

This means I can go in for fine-grained control and so on in a way that is not possible with animated GIF images.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10099
Joined: Fri Feb 19, 2010 10:17 am

Re: gif size

Post by richmond62 » Sun Sep 06, 2020 2:33 pm

Screenshot 2020-09-06 at 16.31.34.png
-
Everything is in the cardScript.
Attachments
Happy Sheep.livecode.zip
Here's the stack
(51.34 KiB) Downloaded 207 times

kwnz
Posts: 14
Joined: Sun Sep 06, 2020 1:25 am

Re: gif size

Post by kwnz » Sun Sep 06, 2020 6:51 pm

Thank you richmond62 for getting to the point (no pun intended) straight away, your answers are much more elegant. I shall try them all and certainly the repeating solution with tweaks to the size so the jump is not so noticeable. Since my post I decided to create half a dozen curves adjacent to each other and base the script on a move for each and a resize line in-between. This worked but tedious and jerky. Thanks again.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10099
Joined: Fri Feb 19, 2010 10:17 am

Re: gif size

Post by richmond62 » Sun Sep 06, 2020 6:54 pm

I have been mucking around with animations in LiveCode for about 12 years, so can "ruin your evening"
with quite a few ideas and examples. 8)

Post Reply