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

Username:   Password: 
 RegisterRegister   
 how to insert images
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
ilovelolli




PostPosted: Sun Jun 18, 2006 10:40 am   Post subject: how to insert images

i've asked this before, but i didnt get a valid answer last time,....

how do u insert images into turing

i have the image in the same folder but i dont know the code to do it

please tell me the x and y thing too

if u could help thanks
Sponsor
Sponsor
Sponsor
sponsor
TheOneTrueGod




PostPosted: Sun Jun 18, 2006 10:49 am   Post subject: (No subject)

Do some research. The Turing Help File is pretty good (F10). Search for Pic functions. There may also be some help in the [Turing Walkthrough]. picID is the picture. It should be declared as an integer, and then use Pic.FileNew to initialize it. (x,y) is the co-ordinates of the picture. finally, the last command is the style that you wish to use. picCopy, picMerge, and picXor are the choices that I know of. You'll probably want to use picCopy or picMerge, depending on what you're doing.

Use the search button on the top to search the site for additional help. Be sure to limit it to the Turing section, and probably even the Turing Tutorials section.
Reality Check




PostPosted: Sun Jun 18, 2006 10:59 am   Post subject: (No subject)

Well, you can just use a command called Pic.ScreenLoad. There is no need for initilization when using this.
ilovelolli




PostPosted: Sun Jun 18, 2006 11:06 am   Post subject: (No subject)

ok i got this

code:

var mario1 : int := Pic.FileNew ("C:\Documents and Settings\kevin\Desktop\turing\mario_right.bmp")

var x, y : int
x := 100
y := 100
Pic.Draw (mario1, x, y, picMerge)


but it says i have error where it says "\k"

*HELP*
TheOneTrueGod




PostPosted: Sun Jun 18, 2006 11:28 am   Post subject: (No subject)

Well, first of all, its much easier when you just use the local directory. However, that said, you don't have a "/k" in there. You have a "/kevin" in there... but thats different... It could be that the directory you are referencing doesn't exist. If the .t file is in the same place as the picture, just use
code:
Pic.FileNew("mario_right.bmp")
. That way it works no matter where the game is "installed".
MysticVegeta




PostPosted: Sun Jun 18, 2006 1:52 pm   Post subject: (No subject)

actually, "\" is a part of Turing-regex, lol. Use "/" instead
Reality Check




PostPosted: Sun Jun 18, 2006 2:00 pm   Post subject: (No subject)

Heres a much easier way. Make sure your "mario_right" picture is in the same folder as your code. Then input this command:

code:

Pic.ScreenLoad ("mario_right.bmp", x, y, picCopy)


Note that the x and y indicates the lower left hand corner of your picture. But don't forget to make sure your picture is in the same directory as your code.
TheOneTrueGod




PostPosted: Sun Jun 18, 2006 2:16 pm   Post subject: (No subject)

Pic.ScreenLoad is only advantageous when you want to load the picture once. If you plan on loading the picture multiple times, or in a loop, its almost allways a better idea to assign it to a variable, via Pic.FileNew. It reduces execution time by quite a bit. Try it!
Sponsor
Sponsor
Sponsor
sponsor
[Gandalf]




PostPosted: Sun Jun 18, 2006 3:32 pm   Post subject: (No subject)

MysticVegeta wrote:
actually, "\" is a part of Turing-regex

Turing regex? Never heard that one before... You probably mean that it's the escape character?
MysticVegeta




PostPosted: Mon Jun 19, 2006 1:11 pm   Post subject: (No subject)

yeah I actually mistyped it, java is getting in my head! I am using ";" for turing these days!!! yeah I meant escape character
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  [ 10 Posts ]
Jump to:   


Style:  
Search: