Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > Code Gallery
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 08-26-2010, 11:49 PM
adam adam is offline
http://wiki.graal.us/
adam's Avatar
Join Date: Nov 2001
Posts: 2,247
adam has a spectacular aura about
Send a message via AIM to adam
Animated Text

Lots of updates since my initial post. Many of which are documented in the class script.

The entire process is attempted to be streamlined.
  1. Join the class to the script.
  2. Make a message(txt) function
  3. Use the message() function and forget about it. Your done. That's it for a simple notification

Although simple means, there's only 1 animated text at a time. If your creative, you could do a chat system with animated texts and whatever else you can think of.



Here's the message() function used in the demo reel. As an example of 'most' features. Although the possibilities are infinite. and Mostly pretty. I still haven't seen anybody try it in -opengl mode or v6, should be nicer.

Don't think this is really complex. Remember, this is the message() function for that entire demo.

Edit: I just updated it, so now it uses less { }'s
PHP Code:
function msg4(txt){
  
this.newText(this300, -this.m.widthscreenheight*.3,txt);
  
//         this, <start index>, <startx>. <starty>, <text>
  //   this, always put that there. Hard to explain that one, just do it.
  //   <start index>, the index it starts drawing from. Uses 3 index's currently, so if you put in 200, be sure the next one is 203 or higher.
  //   <startx>, self explanatory
  //   <starty>, ' '
  //   <text>, ' '
  
this.m.getClicks(); // let's this animated text send out an event when clicked
  
this.m.default_method "easeInOutQuad"// sets the default ease method to use for this animated text.
  
this.m.A( {"balpha"01}, {"talpha"01} );
  
// obj.A( ) this is the function used to queue "actions" for animation.
  // "actions" are blocks that look like this: {<property>, <time>, <value>[, <ease Method>]} or {<action>, <value>}
  // {"width", "height","delay","x","y","zoom","balpha","talpha","bgPadding","outline","tRed","tBlue","tGreen","bRed","bBlue","bGreen","oRed","oGreen","oBlue"}
  // that is the full list of <property>'s that can be animated.
  // {"NewText", "Fixed", "Destroy", "Trigger", "Play"}
  // That is the list of <action>'s that can be used.
  // <time> is how long the <property> takes to change from it's initial value to <value>
  // <ease Method> is "how" the value changes from the old one to the new one. It really makes a huge difference.
  // The best way to know what they do, is to try them out. The names are listed in the class.
  // They are also listed as arrays under the animated text object.   obj.In, obj.Out, obj.InOut .
  // <action>'s are done instantly.  <property>'s are done instantly if you set <time> to 0
  
this.m.A( {"x"2screenwidth*.1,"easeOutElastic"} );
  
this.m.A( {"x"2screenwidth*.4},{"y"2screenheight-this.m.height,"easeOutBounce"} );
  
this.m.A( {"x"2screenwidth*.8},{"y"2screenheight*.3,"easeInBounce"} );
  
this.m.A( {"x"2screenwidth*.3,"easeOutBack"},{"y",2,screenheight*.5,"easeInOutQuad"},{"zoom"21.4} );
  
this.m.A( {"zoom"11.1},{"tred"10},{"tblue"1.3},{"outline"116} );
  for (
temp.i=0temp.i5temp.i++){
    
this.m.A( {"talpha".50},{"balpha".50} );
    
this.m.A( {"NewText""Blinky #" temp.1} );
    
this.m.A( {"talpha".51},{"balpha".51} );
  }
  
this.m.A( {"talpha".50},{"balpha".50} );
  
this.m.A( {"NewText""How do you like the animation so far?"},{"talpha",.5,1},{"balpha"11});
  
this.m.A( {"outline"22},{"bgPadding"216},{"oRed"20},{"oBlue"20} );
  
this.m.A( {"tRed"20},{"tBlue"20},{"bgPadding"22} );
  
this.m.A( {"x"1screenwidth*.05,"easeInExpo"},{"y"1screenheight*.7"easeOutBack"} );
  
this.m.A( {"Fixed",false} );
  
this.m.A( {"width"2screenwidth*.7"easeOutBounce"} );
  
this.m.A( {"talpha".50},{"balpha".50} );
  
this.m.A( {"NewText""Well, do you like it? (Click)"} );
  
this.m.A( {"talpha".51},{"balpha".51} );
  
this.m.A( {"tRed"20},{"tGreen"20},{"tBlue"21},{"oRed"20},{"oGreen"20},{"oBlue"21} );
  
this.m.A( {"delay"4} );
  
this.m.A( {"talpha".50},{"balpha".50} );
  
this.m.A( {"Fixed"true});
  
this.m.A( {"talpha".51},{"balpha".51} );
  
this.m.A( {"zoom"11.3} );
  
this.m.A( {"x"2screenwidth*.3,"easeInBack"},{"y"2screenheight*.3,"easeInBack"} );
  
this.m.A( {"talpha".50} );
  
this.m.A( {"NewText""Well, this demo wasn't that long. :'("} );
  
this.m.A( {"talpha".51},{"Fixed"false},{"delay"3},{"tRed"3.8},{"tGreen"3.8} );
  
this.m.A( {"talpha".50});
  
this.m.A( {"NewText""Well, I hope you liked it anyhow."} );
  
this.m.A( {"talpha".51} );
  
this.m.A( {"delay"3} );
  
this.m.A( {"talpha".50} );
  
this.m.A( {"NewText""Well, Post about it. Bye!"},{"talpha".51},{"oRed"1.8},{"oGreen"1.8},{"oBlue"11} );
  
this.m.A( {"y"4, -70"easeInBack"},{"x"4, -30"easeInElastic" } );
  
this.m.A( {"delay"4} );
  
this.m.A( {"Destroy"} );
  
this.m.start();

And if I remember, I attach the class script.
Oh, and there is sound file support, {"Play", <soundfile>} is the action for that. o.O There's a bit more documentation in comments in the class script, or ask me here.
Attached Files
File Type: txt animated_text.txt (14.3 KB, 314 views)
__________________
Rogue Shadow (TCN)(NAT)(Global Development Team)

For development help, contact the patrons of the #graaldt irc channel below, I am usually there.
Click Here to Join IRC Chat Now! -- irc.freenode.net Channel: #graaldt
Quote:
<Dustyshouri> no, RogueShadow is always talking about scripts lol
<Dustyshouri> in fact, he pretty much brought Graal back as a topic single-handedly

Last edited by adam; 08-27-2010 at 03:27 AM.. Reason: WhiteDragon is correcting my spelling, he better post!
Reply With Quote
  #2  
Old 08-26-2010, 11:58 PM
WhiteDragon WhiteDragon is offline
Banned
Join Date: Feb 2007
Posts: 1,002
WhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to behold
Looks good. Consider thinking about a nicer way of setting options or having new text though, it kind of hurts to look at all of those brackets.
Reply With Quote
  #3  
Old 08-27-2010, 12:04 AM
adam adam is offline
http://wiki.graal.us/
adam's Avatar
Join Date: Nov 2001
Posts: 2,247
adam has a spectacular aura about
Send a message via AIM to adam
Quote:
Originally Posted by WhiteDragon View Post
Looks good. Consider thinking about a nicer way of setting options or having new text though, it kind of hurts to look at all of those brackets.
Yeah, that's quite a lot of brackets. Although I believe it is incredibly simple for the amount of complexity you get back. I agree, there could be a better way.
__________________
Rogue Shadow (TCN)(NAT)(Global Development Team)

For development help, contact the patrons of the #graaldt irc channel below, I am usually there.
Click Here to Join IRC Chat Now! -- irc.freenode.net Channel: #graaldt
Quote:
<Dustyshouri> no, RogueShadow is always talking about scripts lol
<Dustyshouri> in fact, he pretty much brought Graal back as a topic single-handedly
Reply With Quote
  #4  
Old 08-27-2010, 12:14 AM
DrakilorP2P DrakilorP2P is offline
Registered User
DrakilorP2P's Avatar
Join Date: Apr 2006
Posts: 755
DrakilorP2P is just really niceDrakilorP2P is just really nice
Looking smooth.
Reply With Quote
  #5  
Old 08-27-2010, 05:03 AM
adam adam is offline
http://wiki.graal.us/
adam's Avatar
Join Date: Nov 2001
Posts: 2,247
adam has a spectacular aura about
Send a message via AIM to adam
If I can get some takers, to give making a few animations a try, and post some feedback, that'd be great. I wanna make sure it's easy enough to use for everybody.
__________________
Rogue Shadow (TCN)(NAT)(Global Development Team)

For development help, contact the patrons of the #graaldt irc channel below, I am usually there.
Click Here to Join IRC Chat Now! -- irc.freenode.net Channel: #graaldt
Quote:
<Dustyshouri> no, RogueShadow is always talking about scripts lol
<Dustyshouri> in fact, he pretty much brought Graal back as a topic single-handedly
Reply With Quote
  #6  
Old 08-27-2010, 04:20 PM
Dnegel Dnegel is offline
Rjax Shizibz
Join Date: Jul 2009
Posts: 1,334
Dnegel will become famous soon enough
It's really smooth indeed, very clean and nice.
Reply With Quote
  #7  
Old 08-29-2010, 03:45 AM
adam adam is offline
http://wiki.graal.us/
adam's Avatar
Join Date: Nov 2001
Posts: 2,247
adam has a spectacular aura about
Send a message via AIM to adam
Hmm. Having a tough time thinking of a better way to input all that animation data.
__________________
Rogue Shadow (TCN)(NAT)(Global Development Team)

For development help, contact the patrons of the #graaldt irc channel below, I am usually there.
Click Here to Join IRC Chat Now! -- irc.freenode.net Channel: #graaldt
Quote:
<Dustyshouri> no, RogueShadow is always talking about scripts lol
<Dustyshouri> in fact, he pretty much brought Graal back as a topic single-handedly
Reply With Quote
  #8  
Old 08-29-2010, 06:12 AM
salesman salesman is offline
Finger lickin' good.
salesman's Avatar
Join Date: Nov 2008
Location: Colorado
Posts: 1,865
salesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud of
It would be cool to have some kind of interface to control the animations, but that'd become quite the project.
__________________
Reply With Quote
  #9  
Old 08-29-2010, 01:43 PM
adam adam is offline
http://wiki.graal.us/
adam's Avatar
Join Date: Nov 2001
Posts: 2,247
adam has a spectacular aura about
Send a message via AIM to adam
Quote:
Originally Posted by salesman View Post
It would be cool to have some kind of interface to control the animations, but that'd become quite the project.
Yeah... would that ever be a project. I'm not sure it would be any easier, just cooler.
__________________
Rogue Shadow (TCN)(NAT)(Global Development Team)

For development help, contact the patrons of the #graaldt irc channel below, I am usually there.
Click Here to Join IRC Chat Now! -- irc.freenode.net Channel: #graaldt
Quote:
<Dustyshouri> no, RogueShadow is always talking about scripts lol
<Dustyshouri> in fact, he pretty much brought Graal back as a topic single-handedly
Reply With Quote
  #10  
Old 09-10-2010, 12:42 AM
adam adam is offline
http://wiki.graal.us/
adam's Avatar
Join Date: Nov 2001
Posts: 2,247
adam has a spectacular aura about
Send a message via AIM to adam
Bumpity! I spent my birthday working on this, come on post some video replies! What have you thought to do !
__________________
Rogue Shadow (TCN)(NAT)(Global Development Team)

For development help, contact the patrons of the #graaldt irc channel below, I am usually there.
Click Here to Join IRC Chat Now! -- irc.freenode.net Channel: #graaldt
Quote:
<Dustyshouri> no, RogueShadow is always talking about scripts lol
<Dustyshouri> in fact, he pretty much brought Graal back as a topic single-handedly
Reply With Quote
  #11  
Old 12-09-2010, 06:52 AM
adam adam is offline
http://wiki.graal.us/
adam's Avatar
Join Date: Nov 2001
Posts: 2,247
adam has a spectacular aura about
Send a message via AIM to adam
aw, I gave it a few months, nobody wanted to use it?
__________________
Rogue Shadow (TCN)(NAT)(Global Development Team)

For development help, contact the patrons of the #graaldt irc channel below, I am usually there.
Click Here to Join IRC Chat Now! -- irc.freenode.net Channel: #graaldt
Quote:
<Dustyshouri> no, RogueShadow is always talking about scripts lol
<Dustyshouri> in fact, he pretty much brought Graal back as a topic single-handedly
Reply With Quote
  #12  
Old 12-09-2010, 06:54 AM
Fulg0reSama Fulg0reSama is offline
Extrinsical Anomaly
Fulg0reSama's Avatar
Join Date: Sep 2009
Location: Ohio
Posts: 3,049
Fulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant future
Quote:
Originally Posted by adam View Post
aw, I gave it a few months, nobody wanted to use it?
UN kinda did it without the animation
__________________

Careful, thoughts and opinions here scare people.
Reply With Quote
  #13  
Old 12-09-2010, 10:45 AM
Mark Sir Link Mark Sir Link is offline
Kevin Azite
Mark Sir Link's Avatar
Join Date: Sep 2005
Posts: 1,489
Mark Sir Link is just really niceMark Sir Link is just really nice
Send a message via AIM to Mark Sir Link
Quote:
Originally Posted by Fulg0reSama View Post
UN kinda did it without the animation
I believe that system predates RogueShadow's (I recall showing it to him when he first posted about this)
Reply With Quote
  #14  
Old 12-09-2010, 06:54 PM
DrakilorP2P DrakilorP2P is offline
Registered User
DrakilorP2P's Avatar
Join Date: Apr 2006
Posts: 755
DrakilorP2P is just really niceDrakilorP2P is just really nice
Quote:
Originally Posted by adam View Post
aw, I gave it a few months, nobody wanted to use it?
It's hard to make things people want. Have you used it yourself?
Reply With Quote
  #15  
Old 12-12-2010, 10:38 PM
Tigairius Tigairius is offline
The Cat
Tigairius's Avatar
Join Date: Jan 2007
Location: Missouri, USA
Posts: 4,240
Tigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant future
When you posted this, I really didn't want to be a downer since it looked like you worked pretty hard on it... but about 90% of this can be done using the particle engine (which supports text) and it's a lot more efficient to do it that way too.
__________________


“Shoot for the moon. Even if you miss, you'll land among the stars.”
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 12:18 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.