
-----------------------------------
revangrey
Fri Jan 02, 2009 8:04 pm

Importing a picture and using it in an Animation?
-----------------------------------
now I am trying to place a picture in an animation and make that picture move

I was thinking of a Santa in a sleigh making a run across the screen sort of thing

but before I can do that I need to import a picture,
.jpg preferably not those other random things turing supports...


This is what I got from the picture importing thread, by Dan I  believe

var varname :int := Pic.FileNew (" c:\Documents and Settings\My Documents\Administrator\My Pictures\spartan6.jpg")
%to specify the exact location of this file 
       var mypic :int:= Pic.FileNew ("c:\Documents and Settings\My Documents\Administrator\My Pictures\spartan6.jpg") 
       
%to draw the picture in the center of the screen with no mode 
Pic.Draw (mypic, maxx div 2, maxy div 2, 0) 


Any and ALL help is appreciated thanks in advance!

-----------------------------------
Tony
Fri Jan 02, 2009 8:14 pm

RE:Importing a picture and using it in an Animation?
-----------------------------------
importing and using an image of any supported type works the same way.

-----------------------------------
Insectoid
Fri Jan 02, 2009 8:16 pm

RE:Importing a picture and using it in an Animation?
-----------------------------------
Put the image into the folder your code is contained in. That way you don't have to type the whole directory. 


Pic.FileNew ("sparten6.jpg")


I don't know if Turing does this, but many languages use the backslash ('\') as an escape character, meaning it does things to the string :P. To get around that, use a double backslash ('\\'). 

Another thing, if you create the picture when you initialize the variable, you don't need :int. You can just do: 


var mypic := Pic.FileNew ("sparten6.jpg")


Either should work.

-----------------------------------
revangrey
Fri Jan 02, 2009 8:16 pm

Re: Importing a picture and using it in an Animation?
-----------------------------------
ARGH

didnt see you post that sry.
