Computer Science Canada

how do you draw gif animations turing

Author:  josh_65665 [ Fri Mar 14, 2008 10:10 pm ]
Post subject:  how do you draw gif animations turing

i want to make a moving level for a game how do i draw a gif

Author:  CodeMonkey2000 [ Fri Mar 14, 2008 10:20 pm ]
Post subject:  RE:how do you draw gif animations turing

I don't think turing can handle gifs.

Author:  Nick [ Fri Mar 14, 2008 10:25 pm ]
Post subject:  RE:how do you draw gif animations turing

4.1 can I don't know the command though

Author:  josh_65665 [ Fri Mar 14, 2008 11:06 pm ]
Post subject:  turing can handle gifs

i got it to open a gif but it does not play through it and when i do get it to play through it it does not look like the gif i made for example lets say i made a airplane gif and its rotar rotates on turing it would probaly look like a part black screen and part of the screen flashing i need to know how to properly open my gif

Author:  Mackie [ Fri Mar 14, 2008 11:09 pm ]
Post subject:  RE:how do you draw gif animations turing

From Turing Help (F10)

Turing:

% The "Pic.DrawFrames" program.
% Determine the number of frames in "globe.gif"
const fileName := "%oot/Support/Help/Examples/Data Files/globe.gif"
var numFrames : int := Pic.Frames (fileName)
% Load the picture
var delayTime : int
var pics : array 1 .. numFrames of int
Pic.FileNewFrames (fileName, pics, delayTime)
% Set the window to fit the picture
var w := Pic.Width (pics (1)) + 20
var h := Pic.Height (pics (1)) + 20
View.Set ("graphics:" + intstr (w) + ";" + intstr (h) + ",nobuttonbar")
% Display the pictures
for i : 1 .. 50
    Pic.DrawFrames (pics, 10, 10, picCopy, upper (pics), 50, false)
end for


Author:  josh_65665 [ Fri Mar 14, 2008 11:36 pm ]
Post subject:  that does not work

when i run that sample i get a rotating globe but when i change the path of the globe gif to where my gif is it does not work and if any one needs to know i have turing 4.1.1

Author:  Mackie [ Fri Mar 14, 2008 11:38 pm ]
Post subject:  RE:how do you draw gif animations turing

What did you enter exactly as the path? As in EVERYTHING in the quotation marks.

Author:  Nick [ Fri Mar 14, 2008 11:39 pm ]
Post subject:  RE:how do you draw gif animations turing

some gifs do not work

Author:  josh_65665 [ Fri Mar 14, 2008 11:39 pm ]
Post subject:  im thinking of just extracting my gif

i would extract my gif file if i have to but theres so many frames in it i dont want to extract it if i dont need to i know theres a way to put my gif on the screen and have it run properly because the globe.gif works just need working code that will do it

Author:  josh_65665 [ Fri Mar 14, 2008 11:44 pm ]
Post subject:  you would think this would work

this code works for the globe gif but not for my gif why is that



code:

const fileName := "C:/Users/josh/Pictures/level5.gif"
var numFrames : int := Pic.Frames (fileName)

var delayTime : int
var pics : array 1 .. numFrames of int
Pic.FileNewFrames (fileName, pics, delayTime)

var w := Pic.Width (pics (1)) + 20
var h := Pic.Height (pics (1)) + 20



View.Set ("graphics:" + intstr (w) + ";" + intstr (h) + ",nobuttonbar")

for i : 1 .. 50
delay (1000)
    Pic.DrawFrames (pics, 10, 10, 0, upper (pics), 50, false)
end for

Author:  Mackie [ Fri Mar 14, 2008 11:46 pm ]
Post subject:  RE:how do you draw gif animations turing

It's hit or miss. It probably won't work.

Author:  josh_65665 [ Sat Mar 15, 2008 11:51 am ]
Post subject:  any more suggestions?

does any one have any more suggestions

Author:  CodeMonkey2000 [ Sat Mar 15, 2008 12:01 pm ]
Post subject:  RE:how do you draw gif animations turing

Don't use GIFs, store all the images in an array, then draw them one by one.

Author:  josh_65665 [ Sat Mar 15, 2008 12:10 pm ]
Post subject:  ?

how do i do that i dont really know how to use arrays

Author:  A.J [ Sat Mar 15, 2008 1:43 pm ]
Post subject:  Re: how do you draw gif animations turing

I suggest you check out the Turing Walkthrough page and learn about all the basics (plus there are some advanced stuff like recursion)
first Very Happy!

Author:  Nick [ Sat Mar 15, 2008 10:07 pm ]
Post subject:  Re: how do you draw gif animations turing

A.J @ Sat Mar 15, 2008 1:43 pm wrote:
plus there are some advanced stuff like recursion


explain how recursion is needed for drawing images in an array, the way I see it, recursion is not needed

Author:  DaveAngus [ Tue Mar 18, 2008 10:47 am ]
Post subject:  RE:how do you draw gif animations turing

Does anyone know how to make a Mario type game?

Please message me


: