Raised This Month: $12 Target: $400
 3% 

Dynamic HUD


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Scherzo
Senior Member
Join Date: Feb 2007
Location: Kwidzyn, Poland
Old 09-10-2010 , 19:00   Dynamic HUD
Reply With Quote #1

Dynamic HUD
v1.03

Start from see what i mean: http://www.youtube.com/watch?v=mS2aUWay9D4


Interface for making attractive effects on HUD messages. You can prepare animation frame per frame or use filters to work on few frames in one call.

This is separate plugin to install with your plugin, which will use it.


Firstly create new object
Code:
DHUD_create(dhud = -1)
it allow to make copy of another dhud object, to make brand new set dhud=-1 (as in default)





Each frame is descripted by position, color and life (iLen).
Code:
DHUD_setFrame(dhud, frame, iColor[3]={0,0,0}, Float:x=0.0, Float:y=0.0, iLen = 1);
dhud is result of DHUD_create
frame is number of frame; start from 0, when > NUM it add needed frames;
fe. empty dhud object + setting frame=4 will make frames # 0,1,2,3,4

iLen is multiplier of displaying time, frame with iLen=2 will stay on screen twice longer than that with iLen=1


Filters are quick way to set many frames with given scheme
Code:
DHUD_applyFilter(dhud, const szFilter[], startFrame, endFrame, Float:dx=D_LONG, Float:dy=D_ZERO, any:...)
dhud is result of DHUD_create
szFilter[] is name of filter, type 'dhud info' in console to view list

startFrame - endFrame on these frames filter will work, endFrame can`t be greater than num of frames, so before call make sure that in dhud has enough frame,
in other case it will be clamped to 0-NUMFRAMES,

dx, dy when you want to draw path of function it allow you to autoincrement/decrement position
example is in in attachment, there is sinus function, just set first frame(0) to your values and call with dx!=0.0 ; filter will get linear growing/falling values of x,y

... are additional parameter of filter, listed in 'dhud info'


The most basic filters are SetPosition (Float, Float:y) and SetColor(r, g, b)

Code:
DHUD_setFrame(dhud, 50); 
DHUD_applyFilter(dhud, "SetPosition", 0, 50, D_ZERO, D_ZERO, 0.5, 0.5); 
DHUD_applyFilter(dhud, "SetColor", 0, 50, D_ZERO, D_ZERO, 255, 255, 255);
One other is TransColor(start[3], target[3])



To display Dynamic HUD message use
Code:
DHUD_display(id, dhud, Float:fInterval = 0.1, channel = 4, const szMessage[], any:...)
id - player or 0 for all
dhud - dhud object
fInterval - time of displaying frame with iLen=1
channel - hud channel 1-4
szMessage[],... - message to display, Warning:message for all not realize valid %L LANG_PLAYER
Attached Files
File Type: sma Get Plugin or Get Source (dHUD.sma - 1863 views - 16.9 KB)
File Type: inc dHUD.inc (4.9 KB, 1143 views)
File Type: sma Get Plugin or Get Source (dHUD_test.sma - 1924 views - 2.3 KB)

Last edited by Scherzo; 09-11-2010 at 08:12.
Scherzo is offline
alan_el_more
Veteran Member
Join Date: Jul 2008
Location: amxmodx-es.com
Old 09-11-2010 , 06:21   Re: Dynamic HUD
Reply With Quote #2

WOW, THIS IS REALLY A - W - E - S - O - M - E !!!!
__________________
alan_el_more is offline
DaxProxy
Senior Member
Join Date: Sep 2007
Old 09-11-2010 , 07:19   Re: Dynamic HUD
Reply With Quote #3

Now i actually might use a hud message or two.
__________________

Want ApolloRP for Counter-Strike? Show your support: http://forums.alliedmods.net/showthr...39#post1264739
DaxProxy is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 09-11-2010 , 15:50   Re: Dynamic HUD
Reply With Quote #4

Actually this is really nice, i had in mind something like this but w/e. Gj
__________________
Still...lovin' . Connor noob! Hello
Alka is offline
Scherzo
Senior Member
Join Date: Feb 2007
Location: Kwidzyn, Poland
Old 09-11-2010 , 16:56   Re: Dynamic HUD
Reply With Quote #5

Thanks for comments

There is one more .sma which I used for make video. First post has enough attachments I didnt include some functions in description, but I believe these samples and .inc file will be helpful.
Attached Files
File Type: sma Get Plugin or Get Source (dHUD_circle.sma - 1240 views - 3.0 KB)
Scherzo is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 09-11-2010 , 18:06   Re: Dynamic HUD
Reply With Quote #6

Quite creative. Good job.
__________________
Arkshine is offline
abdul-rehman
Veteran Member
Join Date: Jan 2010
Location: Khi, Pakistan
Old 09-12-2010 , 03:06   Re: Dynamic HUD
Reply With Quote #7

Its COOLL
__________________

My Plugins For ZP

Inactive due to College and Studies

Last edited by abdul-rehman; 09-13-2010 at 02:54.
abdul-rehman is offline
Send a message via Yahoo to abdul-rehman Send a message via Skype™ to abdul-rehman
albert123
Veteran Member
Join Date: Mar 2009
Location: VietNam, Hai Phong
Old 09-13-2010 , 01:42   Re: Dynamic HUD
Reply With Quote #8

Very useful..you're awesome!
__________________
albert123 is offline
Owner123
Member
Join Date: Jun 2010
Old 09-13-2010 , 08:39   Re: Dynamic HUD
Reply With Quote #9

O f*ck, really AWESOME. GJ!
__________________
Sorry for my bad english !
Owner123 is offline
Moe
Member
Join Date: Dec 2009
Location: GTA
Old 09-13-2010 , 20:43   Re: Dynamic HUD
Reply With Quote #10

Nice man, good idea! =)
Moe is offline
Reply


Thread Tools
Display Modes

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 -4. The time now is 08:22.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode