how to insert images
Author |
Message |
ilovelolli
|
Posted: 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 |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
TheOneTrueGod
![](http://www.drmcninja.com/images/mcninjab3.jpg)
|
Posted: 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. |
|
|
|
|
![](images/spacer.gif) |
Reality Check
|
Posted: 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. |
|
|
|
|
![](images/spacer.gif) |
ilovelolli
|
Posted: 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* |
|
|
|
|
![](images/spacer.gif) |
TheOneTrueGod
![](http://www.drmcninja.com/images/mcninjab3.jpg)
|
Posted: 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". |
|
|
|
|
![](images/spacer.gif) |
MysticVegeta
![](http://www.geocities.com/ohsoinsane/my_avatar.JPG)
|
Posted: Sun Jun 18, 2006 1:52 pm Post subject: (No subject) |
|
|
actually, "\" is a part of Turing-regex, lol. Use "/" instead |
|
|
|
|
![](images/spacer.gif) |
Reality Check
|
Posted: 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. |
|
|
|
|
![](images/spacer.gif) |
TheOneTrueGod
![](http://www.drmcninja.com/images/mcninjab3.jpg)
|
Posted: 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! |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
[Gandalf]
![](http://compsci.ca/v3/uploads/user_avatars/189297994e4c716fec7f1.png)
|
Posted: 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? |
|
|
|
|
![](images/spacer.gif) |
MysticVegeta
![](http://www.geocities.com/ohsoinsane/my_avatar.JPG)
|
Posted: 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 |
|
|
|
|
![](images/spacer.gif) |
|
|