Author |
Message |
Quakerstate98
|
Posted: Sun Jun 18, 2006 2:45 pm Post subject: Pic.Draw |
|
|
Is there a way to call a picture into you program from a different folder. Like if the turing exe. is in folder A and i want all my pics to be in folder B how would i call them. |
|
|
|
|
![](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 3:13 pm Post subject: (No subject) |
|
|
Use the backslash key ("/").
Eg
code: | Pic.FileNew("Pictures/MainCharacter/Mario.bmp") |
Its allways a better idea not to use the entire directory, because when you hand this in to a teacher, or when/if you submit it to this site, people won't be able to play your game. |
|
|
|
|
![](images/spacer.gif) |
Ninja
|
Posted: Sun Jun 18, 2006 3:14 pm Post subject: (No subject) |
|
|
make a variable called pic2 for example, and then you can assign the path of the picture like this :
code: | var pic2 : int := Pic.FileNew ("C:\MyFolder\picture.jpg") |
[/code]
Thats an example that i use in some of my programs. To call any file from a folder, you have to sepecify the path of the file when you declare it in a variable |
|
|
|
|
![](images/spacer.gif) |
[Gandalf]
![](http://compsci.ca/v3/uploads/user_avatars/189297994e4c716fec7f1.png)
|
Posted: Sun Jun 18, 2006 3:27 pm Post subject: (No subject) |
|
|
Note that you can also use .. to signify the parent folder, for example:
code: | var pic := Pic.FileNew ("../../picture.jpg") |
Will assign that variable the picture named "picture.jpg" located two folders above the current folder. |
|
|
|
|
![](images/spacer.gif) |
Quakerstate98
|
Posted: Sun Jun 18, 2006 6:36 pm Post subject: i got another question |
|
|
Transperency, turing doesn't support picture files that support transparency, i really need it any suggestions? |
|
|
|
|
![](images/spacer.gif) |
[Gandalf]
![](http://compsci.ca/v3/uploads/user_avatars/189297994e4c716fec7f1.png)
|
Posted: Sun Jun 18, 2006 6:46 pm Post subject: (No subject) |
|
|
Turing 4.1 does. But if that doesn't apply, then you could always use a bitmap (.bmp) and use the Pic.SetTransparentColour procedure to set the transparency colour yourself. |
|
|
|
|
![](images/spacer.gif) |
Quakerstate98
|
Posted: Sun Jun 18, 2006 7:02 pm Post subject: how does it work |
|
|
how does the PicSet transperency work? |
|
|
|
|
![](images/spacer.gif) |
[Gandalf]
![](http://compsci.ca/v3/uploads/user_avatars/189297994e4c716fec7f1.png)
|
Posted: Sun Jun 18, 2006 7:05 pm Post subject: (No subject) |
|
|
Do you have access to the help files? Next time, check there. This example is directly copied from those help files:
code: | var pic1 : int := Pic.FileNew ("airplane.bmp")
var pic2 : int := Pic.FileNew ("airplane.bmp")
Pic.SetTransparentColor (pic2, brightred)
setscreen ("offscreenonly")
for x : 100 .. maxx - 100
cls
put "The lower image has the transparent color set to bright red"
Pic.Draw (pic1, x, 150, picMerge)
Pic.Draw (pic2, x, 50, picMerge)
View.Update
delay (5)
end for
|
|
|
|
|
|
![](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 8:03 pm Post subject: (No subject) |
|
|
Actually, If you use paint, it has a background colour. I believe theres a way to change it, but it starts off as the white thats in the background. If you use picMerge then it ignores the background colour . |
|
|
|
|
![](images/spacer.gif) |
Delos
![](http://www.members.shaw.ca/rfolz/delos_avatar.gif)
|
Posted: Sun Jun 18, 2006 8:54 pm Post subject: (No subject) |
|
|
It ignores white because the default value of colourbg is 0 - white. Try it out. Using SetTransparentColour() changes this value for that pic stream. |
|
|
|
|
![](images/spacer.gif) |
TheOneTrueGod
![](http://www.drmcninja.com/images/mcninjab3.jpg)
|
Posted: Sun Jun 18, 2006 8:58 pm Post subject: (No subject) |
|
|
Really? How come I've had the program ignore a greenish colour once before then? (There is no emoticon to emote this. I'll use the MSN one [:S]) |
|
|
|
|
![](images/spacer.gif) |
Delos
![](http://www.members.shaw.ca/rfolz/delos_avatar.gif)
|
Posted: Mon Jun 19, 2006 10:26 am Post subject: (No subject) |
|
|
You mean without explicitely setting a TransparentColour? I didn't think that was possible - it doesn't make much sense. When a bitmap is created, there's no distinction between fore- and background-colours in the data itself. Those are (AFAIK) manipulations imposed by the graphics packages that use them. .gifs, on the other hand, do define transparent colours intrinsically.
Perhaps if you can replicate this incident we'll be able to get to the bottom of this mystery...
/cue dramatic music.
PS: Were you looking for this: ? |
|
|
|
|
![](images/spacer.gif) |
|