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

Username:   Password: 
 RegisterRegister   
 Importing a picture
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
SunsFan13




PostPosted: Thu May 15, 2008 9:47 am   Post subject: Importing a picture

Hey guys, I've got no idea how to do this..
I'd like to import a picture I've made (as a title page kinda deal), then have the user press any key to continue on to the game.
Someone help me with this?

Thanks,
Chris
Sponsor
Sponsor
Sponsor
sponsor
Tallguy




PostPosted: Thu May 15, 2008 11:49 am   Post subject: RE:Importing a picture

loop
Pic.ScreenLoad ("picname.jpg", 125, 40, picCopy)
exit when hasch
end loop
**GAME CODE**

-make sure that the picture is in the same folder as the program
petree08




PostPosted: Thu May 15, 2008 12:17 pm   Post subject: RE:Importing a picture

code:

var PicID : int
var Pauser : char

PicID := Pic.FileNew ("filename.fileype")

Pic.Draw (PicID, 1, 1, picCopy)
Pauser := getchar



this way is better than the above because there is no unessecary looping and your not loading a sprite over and over again,
Tallguy




PostPosted: Fri May 16, 2008 10:03 am   Post subject: RE:Importing a picture

the one i posted is easier for people just getting into programming
S_Grimm




PostPosted: Fri May 16, 2008 10:27 am   Post subject: RE:Importing a picture

I agree with tallguy. his is a lot easier to use. if you dont want to use the user input, then just use the Pic.ScreenLoad (............) and a delay (time).
Sean




PostPosted: Fri May 16, 2008 11:35 am   Post subject: Re: Importing a picture

However the one that he is using, is constantly re-drawing the same image over and over again. Just doing it once is fine enough.

Turing:

var PicID : int := Pic.FileNew ("Picture.extension")

Pic.Draw (PicID, 50,50, picCopy)


One picture drawn, not continueous, and not asking for user input.
Tallguy




PostPosted: Fri May 16, 2008 12:27 pm   Post subject: RE:Importing a picture

yes, but you need to procede once 'hasch', so a loop is needed
gitoxa




PostPosted: Fri May 16, 2008 1:05 pm   Post subject: RE:Importing a picture

turing is srs bzns
code:
var PicID : int := Pic.FileNew ("Picture.extension")
Pic.Draw (PicID, 50,50, picCopy)
loop
    exit when hasch
end loop


NOTE HOW THE PICTURE BEING DRAWN ISNT IN THE LOOP. I KNOW IT'S A HARD CONCEPT BUT PLEASE BEAR WITH US.
Sponsor
Sponsor
Sponsor
sponsor
petree08




PostPosted: Fri May 16, 2008 1:19 pm   Post subject: RE:Importing a picture

As for "easier for people starting programing"

it is probably better to teach them the right way first to avoid picking up bad coding habits
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  [ 9 Posts ]
Jump to:   


Style:  
Search: