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

Username:   Password: 
 RegisterRegister   
 Overlapping pics and adding mp3 files
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Angel




PostPosted: Fri Jan 02, 2004 7:37 pm   Post subject: Overlapping pics and adding mp3 files

PLEASE HELP ME OVERLAP PICTURES AND TEXT AND DO SPECIAL EFFECTS AND ADD MP3 FILES TO MY PROGRAM!!! Crying or Very sad
Sponsor
Sponsor
Sponsor
sponsor
AsianSensation




PostPosted: Fri Jan 02, 2004 9:09 pm   Post subject: (No subject)

TO USE MP3, USE Music.PlayFile FUNCTION

TO OVERLAP PICTURES, USE picCopy AS YOUR MODE WHEN USING Pic.Draw

TO CREATE SPECIAL EFFECTS, ALL YOU NEED IS TO BE HIT BY HEAVENLY INSPIRATION, AND THEN CODE IT YOURSELF.

BTW, THE POINT OF THIS IS DON'T TYPE IN ALL CAPS, IT'S VERY ANNOYING
Angel




PostPosted: Fri Jan 02, 2004 9:55 pm   Post subject: Overlapping text and pictures and attaching mp3s

Ok, sry about the caps thing... Ok, here's the thing. I tried doing the Music.PlayFile thing or whatever you call it, but nothing happens. It just says that "the program has been executed". I don't know what else to do.
Sad
Here's an example of when pictures are supposed to overlap (it's an example from some tutorial or something):

% The "ShowJPEG" program.
var pic : int := Pic.FileNew ("lighthouse.jpg")
if pic = 0 then
put "Unable to load JPEG: ", Error.LastMsg
return
end if
Pic.Draw (pic, 0, 0, picCopy)
var slantedPic : int := Pic.Rotate (pic, 45, -1, -1)
Pic.Draw (slantedPic, 100, 0, picCopy)

But when you run the program, yeah it overlaps but you can't see the other picture from underneath. And same with text. I wanted to put text over an oval (you can clearly tell that I'm a newbee but anyway...) and so I put:

colourback(black)
colour(13)
put "..."

And the text showed up on the oval, but there were black lines coming out of it on the side. So any suggestions on how I can fix that? Please help. This is for an important ISP and I really need to pull up my marks! Thanks. Question
AsianSensation




PostPosted: Fri Jan 02, 2004 11:34 pm   Post subject: (No subject)

ok, to output like what you suggested, you would probably need Font.Draw. It's just like the Pic.Draw command, except now you are importing some kind of font.

to play music simultaneously with your program, do this:

code:
process bgmusic
loop
   Music.PlayFile ("Right Thurr.mp3") %or whatever your file name is, make sure to include the address too
end loop
end bgmusic


and to put something over something, all you need to do is place your code differently.
code:

Pic.Draw (something here)
Font.Draw (something here)


is different from:
code:

Font.Draw (something here)
Pic.Draw (something here)


the one that is first "read" by the compiler occurs first. So you need to structure your code.
Angel




PostPosted: Sat Jan 03, 2004 12:16 am   Post subject: Fonts and music

Ok, well so far I have figured out how to overlap pictures using picMerge and just display them in general. (Very new at this.)

I also figured out how to get what I want with the font except one thing. How can I do a colourback on a font that's already on top of some pics? This is what I typed in:

var font1 := Font.New ("arial:36")
colourback(13)
Draw.Text ("AnGeL", maxx div 2, maxy div 2, font1, black)


The font shows up and everything, but the colourback doesn't. Do you know how I can fix that? And I was also wondering if it's possible to make a sliding affect of the font onto the screen. If so, can you please tell me how I can do that? Thanks. Exclamation
AsianSensation




PostPosted: Sat Jan 03, 2004 1:08 pm   Post subject: (No subject)

code:
colorback (13)
cls


then the background will change color.
Angel




PostPosted: Sat Jan 03, 2004 1:24 pm   Post subject: Fonts and the delay effect

Ok, thanks. It worked Smile. Now just another thing if you don't mind. I have this other code that I want to combine with another one. Here, I'll show you what I mean:

code:
var font1 := Font.New ("ravie:36")
colourback(13)
Draw.Text ("AnGeL", maxx div 2, maxy div 2, font1, white)


Ok, and I want to combine it with this one:

code:
colourback (13)
colour (black)
locate (7, 2)
delay (100)
put "W " ..
delay (100)
put "E " ..
delay (100)
put "L " ..
delay (100)
put "C " ..
delay (100)
put "O " ..
delay (100)
put "M " ..
delay (100)
put "E " ..
delay (100)
put "  " ..


So basically what I want is instead of where it says "AnGeL" I was to use that code up there with all the delay effects. Is there any way to do it besides repeating that code for each letter?
AsianSensation




PostPosted: Sat Jan 03, 2004 2:37 pm   Post subject: (No subject)

Im not sure what you mean, but are you asking for something like this?

code:
colourback (13)
colour (black)
cls

var word := "A n G e L"
var font1 := Font.New ("ravie:36")
var x := (maxx - Font.Width (word, font1)) div 2
var y := (maxy - 36) div 2

for rep : 1 .. length (word)
    delay (100)
    Font.Draw (word (rep), x, y, font1, white)
    x += (Font.Width (word (rep), font1))
end for
Angel




PostPosted: Sat Jan 03, 2004 2:57 pm   Post subject: (No subject)

Thank you so much! You're a genius! But can you please explain each function in the code using % because I also wanna understand what's happening in the code. And what do you have to alter to change the position of the text? Thanks. Very Happy

Do you also know how I can put a coloured box behind each letter using that code that you gave me?
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: