View unanswered posts | View active topics It is currently Thu Dec 26, 2024 4:59 am



Reply to topic  [ 1 post ] 
 Big Banner Control 
Author Message
DRL Developer
DRL Developer
User avatar

Joined: Wed Dec 13, 2006 5:27 am
Posts: 3138
Location: A little south and a lot west of Moscow
Reply with quote
Post Big Banner Control
So, here's some undocumented functionality that you guys might want to play with. It was just added in B25, and the documentation but seems to be having some issues putting it up on the wiki.
You can control the huge text banners ("GO!", "WIN", "FAIL"). Here's a little guide for how to do it.

First, you need to get the banner itself from the activity that it's attached to by calling Activity:GetBanner. This only seems to work if you have a reference to the script instance of the activity (so, ActivityMan:GetActivity won't work in this case). Here are its arguments:
  • Which color banner to get. Your choices are GUIBanner.RED and GUIBanner.YELLOW.
  • Which player's banner to get.

Next, you need to call GUIBanner:ShowText. These are its arguments:
  • The text to display.
  • The animation mode to display the text in. Your choices are GUIBanner.BLINKING, GUIBanner.FLYBYLEFTWARD and GUIBanner.FLYBYRIGHTWARD.
  • The duration of the animation the text is displayed in. Negative value means the text pauses at the display/center until HideText is called. This is how long the letters will stay on the screen once they've all arrived.
  • The width and height of the bitmap target this will be displayed on. You should almost always set this to Vector(FrameMan.PlayerScreenWidth, FrameMan.PlayerScreenHeight).
  • The Y position the banner should appear on the target, in normalized value. 0.5 = banner midline is centered on halfway down the target.
  • The speed at which the characters will fly, in pixels per second.
  • The spacing between the flying characters, in pixels. For instance, if you set this to 10, the second letter won't fly on until the second one is 10 pixels from the side of the screen. If you set this to the full width of the bitmap target, the letters will fly on one at a time.

Lastly, if you set the animation duration to -1, the letters will arrive on-screen and stay there until you call GUIBanner:HideText. Its arguments are:
  • The speed at which the characters will fly, in pixels per second.
  • The spacing between the flying characters, in pixels.

So, here's an example usage:
Code:
local banner = self:GetBanner(GUIBanner.RED, Activity.PLAYER_1)
banner:ShowText("FREE CRABS!", GUIBanner.FLYBYLEFTWARD, 1000, Vector(FrameMan.PlayerScreenWidth, FrameMan.PlayerScreenHeight), 0.5, 1000, 100);


And the result:
Image


Fri Aug 12, 2011 9:24 pm
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 1 post ] 

Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.042s | 13 Queries | GZIP : Off ]