Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Is there a way to transfer backgrounds from paint into turing?
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Koriandr




PostPosted: Sun Dec 16, 2012 1:04 pm   Post subject: Is there a way to transfer backgrounds from paint into turing?

What is it you are trying to achieve?
I'm trying to make an intersection with sidewalks and other small details but it's taking me forever to finish it in turing.

What is the problem you are having?
I want to try and make a background in paint and just transfer it into turing but I'm not sure how to do this. I've seen others do it, but I have no idea how it was done. If this isn't possible or just a hard method, I'd love to hear more efficient ways of doing this instead of by mine so far.

Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)

Turing:

%Ground
colorback (black)
cls
%Grass
%Bottom left
Draw.FillBox (0,0,220,125,green)
%Top right
Draw.FillBox (650,400,420,275,green)
%Bottom right
Draw.FillBox (650,0,420,125,green)
%Top left
Draw.FillBox (0,400,220,275,green)

%Sidewalk
%Top left
Draw.FillBox (650,280,0,293,white)
Draw.FillBox (215,280,200,400,white)


Please specify what version of Turing you are using
4.1.2 for windows
Sponsor
Sponsor
Sponsor
sponsor
DemonWasp




PostPosted: Sun Dec 16, 2012 1:48 pm   Post subject: RE:Is there a way to transfer backgrounds from paint into turing?

It's not so much "import" as it is "load an image".

Use paint (or whatever else) to make the image you want to load. Save it as a .bmp or .gif or .jpg .

In Turing, use the Pic.FileNew command (look it up in the Turing Help) to get a picture ID. Then, instead of drawing all those lines, use Pic.Draw ( picID ).

When you don't need the image anymore (program shutting down?) you should use Pic.Free ( pictureId ) to unload the image.

Make sure you only call Pic.FileNew once for each image you want to load. Each time you call it, it will load the image from disk (very slow).
Koriandr




PostPosted: Sun Dec 16, 2012 1:57 pm   Post subject: Re: RE:Is there a way to transfer backgrounds from paint into turing?

DemonWasp @ Sun Dec 16, 2012 1:48 pm wrote:
It's not so much "import" as it is "load an image".

Use paint (or whatever else) to make the image you want to load. Save it as a .bmp or .gif or .jpg .

In Turing, use the Pic.FileNew command (look it up in the Turing Help) to get a picture ID. Then, instead of drawing all those lines, use Pic.Draw ( picID ).

When you don't need the image anymore (program shutting down?) you should use Pic.Free ( pictureId ) to unload the image.

Make sure you only call Pic.FileNew once for each image you want to load. Each time you call it, it will load the image from disk (very slow).


So where have I gone wrong here? The program runs, but comes up blank.

Turing:

var inter :int := Pic.FileNew ("inter.bmp")
Pic.Draw (inter, maxx div 2, maxy div 2, 0)
delay (4000)
cls
Pic.Free (inter)


Thanks a lot for the help Smile
Koriandr




PostPosted: Sun Dec 16, 2012 3:25 pm   Post subject: RE:Is there a way to transfer backgrounds from paint into turing?

Oh god, after an hour of playing with it I got it to work. After fixing it, I experienced the best 2 seconds of my life..
I had to write the entire path and it only worked for some reason in my turing folder o.o
I don't know why my original one didn't work still..?
DemonWasp




PostPosted: Sun Dec 16, 2012 3:44 pm   Post subject: RE:Is there a way to transfer backgrounds from paint into turing?

To work properly, relative pathnames should be relative-to the Turing file they are loaded from. So if your .t file is in Documents/Turing/foo.t then your image should be Documents/Turing/inter.bmp (for example).

You should also launch Turing by double-clicking on the .t file rather than opening your file through Turing itself: Turing is very dumb and screws up relative pathnames when started by itself, if I recall correctly.

You can put your images in a folder by adding "foldername/" to the path to load: "imgs/inter.bmp" will look under Documents/Turing/imgs/inter.bmp . You can go "up" a directory by using "..", as in: "imgs/../inter.bmp" will refer to Documents/Turing/inter.bmp. You shouldn't have to use that, but it may be useful.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 5 Posts ]
Jump to:   


Style:  
Search: