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

Username:   Password: 
 RegisterRegister   
 confused with Pic.Free
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
tenniscrazy




PostPosted: Thu May 24, 2007 5:00 pm   Post subject: confused with Pic.Free

in our program we have an intro text thing, and it cretes alot of pics, soit was making our program laggy. But when i tried to use Pic.Free, it wouldn't work...it came up as errors on all of the variables. does someone know why?

heres the code:

code:
loop
    Font.Draw ("In the cold heart of Mount Fugi", 100, 100, f, black) %Alrighty
    %then, first we need to get some font going
    var p1 := Pic.New (90, 70, 600, 160) %this bad boy is to label the text I.E.
    %This is p1 and the next one is p2 and so on and so forth
    cls %and as we all know, money can't buy happiness :D
    Font.Draw ("In the cold heart of Mount Fugi", 100, 100, f, white) %this is
    %Darnai's artistic touch, this second part causes the fade. Bow Chicka wahwah
    var p2 := Pic.New (90, 70, 600, 160) %You know what this is
    cls
    Font.Draw ("I have trained a Ninja", 100, 100, f, black)
    var p3 := Pic.New (90, 70, 600, 160)
    cls
    Font.Draw ("I have trained a Ninja", 100, 100, f, white)
    var p4 := Pic.New (90, 70, 600, 160)
    cls
    Font.Draw ("His name, too dangerous to speak", 100, 100, f, black)
    var p5 := Pic.New (90, 70, 600, 160)
    cls
    Font.Draw ("His name, too dangerous to speak", 100, 100, f, white)
    var p6 := Pic.New (90, 70, 600, 160)
    cls
    Font.Draw ("To take what is rightfully ours", 100, 100, f, black)
    var p7 := Pic.New (90, 70, 600, 160)
    cls
    Font.Draw ("To take what is rightfully ours", 100, 100, f, white)
    var p8 := Pic.New (90, 70, 600, 160)
    cls
    Font.Draw ("And he will face incredible odds", 100, 100, f, black)
    var p9 := Pic.New (90, 70, 600, 160)
    cls
    Font.Draw ("And he will face incredible odds", 100, 100, f, white)
    var p10 := Pic.New (90, 70, 600, 160)
    cls
    Font.Draw ("He will face demons no man should face", 100, 100, g, black)
    var p11 := Pic.New (90, 70, 600, 160)
    cls
    Font.Draw ("He will face demons no man should face", 100, 100, g, white)
    var p12 := Pic.New (90, 70, 600, 160)
    cls
    Font.Draw ("Otherwise, he will suffer", 100, 100, f, black)
    var p13 := Pic.New (90, 70, 600, 160)
    cls
    Font.Draw ("Otherwise, he will suffer", 100, 100, f, white)
    var p14 := Pic.New (90, 70, 600, 160)
    cls
    Font.Draw ("Presenting", 100, 100, f, black)
    var p15 := Pic.New (90, 70, 600, 160)
    cls
    Font.Draw ("Presenting", 100, 100, f, white)
    var p16 := Pic.New (90, 70, 600, 160)
    cls
    Font.Draw ("Pac Ninja The Game", 100, 100, f, black)
    var p17 := Pic.New (90, 70, 600, 160)
    cls
    Font.Draw ("Pac Ninja The Game", 100, 100, f, white)
    var p18 := Pic.New (90, 70, 600, 160)
    cls
    %----------------------------------------------------------
    Pic.DrawSpecial (p1, 10, 200, picCopy, picFadeIn, 1000) %As we all know, everything has a beginning.
    exit when hasch
    Pic.DrawSpecial (p2, 10, 200, picCopy, picFadeIn, 1000) %this code is to trigger the text we have seen earlier.
    exit when hasch
    Pic.DrawSpecial (p3, 10, 200, picCopy, picFadeIn, 1000) %picFadeIn is to create the fade in effect.
    exit when hasch
    Pic.DrawSpecial (p4, 10, 200, picCopy, picFadeIn, 1000)
    exit when hasch
    Pic.DrawSpecial (p5, 10, 200, picCopy, picFadeIn, 1000)
    exit when hasch
    Pic.DrawSpecial (p6, 10, 200, picCopy, picFadeIn, 1000)
    exit when hasch
    Pic.DrawSpecial (p7, 10, 200, picCopy, picFadeIn, 1000)
    exit when hasch
    Pic.DrawSpecial (p8, 10, 200, picCopy, picFadeIn, 1000)
    exit when hasch
    Pic.DrawSpecial (p9, 10, 200, picCopy, picFadeIn, 1000)
    exit when hasch
    Pic.DrawSpecial (p10, 10, 200, picCopy, picFadeIn, 1000)
    exit when hasch
    Pic.DrawSpecial (p11, 10, 200, picCopy, picFadeIn, 1000)
    exit when hasch
    Pic.DrawSpecial (p12, 10, 200, picCopy, picFadeIn, 1000)
    exit when hasch
    Pic.DrawSpecial (p13, 10, 200, picCopy, picFadeIn, 1000)
    exit when hasch
    Pic.DrawSpecial (p14, 10, 200, picCopy, picFadeIn, 1000)
    exit when hasch
    Pic.DrawSpecial (p15, 10, 200, picCopy, picFadeIn, 1000)
    exit when hasch
    Pic.DrawSpecial (p16, 10, 200, picCopy, picFadeIn, 1000)
    exit when hasch
    Pic.DrawSpecial (p17, 10, 200, picCopy, picFadeIn, 1000)
    exit when hasch
    Pic.DrawSpecial (p18, 10, 200, picCopy, picFadeIn, 1000)
    exit
end loop
Pic.Free (p1)
Pic.Free (p2)
Pic.Free (p3)
Pic.Free (p4)
Pic.Free (p5)
Pic.Free (p6)
Pic.Free (p7)
Pic.Free (p8)
Pic.Free (p9)
Pic.Free (p10)
Pic.Free (p11)
Pic.Free (p12)
Pic.Free (p13)
Pic.Free (p14)
Pic.Free (p15)
Pic.Free (p16)
Pic.Free (p17)
Pic.Free (p18)
Sponsor
Sponsor
Sponsor
sponsor
Cervantes




PostPosted: Thu May 24, 2007 9:37 pm   Post subject: RE:confused with Pic.Free

You declared your picture variables (p1 through 18) inside your loop, which means they are local to the loop. They don't exist outside the loop.
That's why you get errors like 'p1 has not been declared'.

Also, you should REALLY learn about arrays. They'll make this all very much easier.

Lastly, you can do all sorts of effects with text, without resorting to this Pic.DrawSpecial procedure that I don't have access to because I'm using v4.0.5. Check out the RGB module. I can only guess at the effect you're trying to achieve, but if I guess correctly (fading text in), you can easily do it with the RGB module.

Hope this helps
tenniscrazy




PostPosted: Fri May 25, 2007 10:12 am   Post subject: RE:confused with Pic.Free

thanks for the help.

i know everything would be easier with arrays...but...my teacher says they're too advanced for grade 10, so we have to use other methods.

and we are going for the fade in effect.
Cervantes




PostPosted: Fri May 25, 2007 4:51 pm   Post subject: RE:confused with Pic.Free

Did your teacher say that specifically to you, or to the class in general. Did your teacher say that you HAVE to use other methods, or did she recommend it? Is there an alternative method that doesn't involve making so many variables like you've done? Try to answer these questions, and then decide what to do. If you think using arrays would be best, 99.9% of the time you should go ahead and learn the material and use it. As the famous quote goes, "Never let school interfere with your education."
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  [ 4 Posts ]
Jump to:   


Style:  
Search: