Jump to content

[REL]GTAIV-style hud 1.3 RELEASED


karlis

Recommended Posts

GTAIV style hud

>>>DOWNLOAD<<<

I'm making a new hud, iv style

heres current progress(the border is now changed, watch screens from community page):

mjv1o2.png

24lmzyu.png

71tc8m.png

rtneqo.jpg

FEATURES

Radar

-full rotation support

-velocity change zoom, just like in original hud

-possibility to put own map files on it

-controllable additional, smooth zoom (hold keys: - and = )

-round shape

-correctly handling being out of world bounds

-altimeter

Blips

-all ingame blips supported

-blip size, color support

-blips is drawn in getBlipOrdering() order

-standart blip(id 0) shows up or down

-blips with id 2 and 3 support rotation, in case they are attached to someone/something

-by default north and player blip is added

-possibility for loading custom blip icon, by doing following:

setElementData(yourBlip,"customBlipPath","your_path_here.png") 

heres list of other blips included, that are not standard(do the code shown above, with filepath as described below)

  
"images/blips/vehicle.png" --romb shape blip with another romb inside 
"images/blips/pedvehicle.png" --romb shaped blip 
"images/blips/ped.png" --small round blip 
"images/blips/pickup0.png" --small hearth, used for hp pickup representation 
"images/blips/pickup1.png" --armor icon, used for armor pickup representation 
"images/blips/pickup2.png" --small pistol icon, used for weapon pickup representation 
  

-tagging blips with text

by default text shows for vehicle and player attached blips, showing vehicle name or nick(nick is colored appropriate)

you can color-code the text with #RRGGBB code.

can be changed by

setElementData(theBlip,"blipText",text) 
--3rd arg: nil/false=default, true=don't draw, string=your text 

-HD(32*32)blips, no more ugly blurry blips from default SA(thanks to Aiboforcen)

Radio HUD

11hxpi1.png

sonunoka.jpg

-animated

-with cool icons

-fading when not used

[future]ability to connect to custom audio stream with it

HP and Armor bar

-round shape hp and armor bar around the radar

-precision of bar: +/- 1%(basically full precision)

-in case there's no armor full ring is used for drawing hp

-if you have hp under 10% hp bar is red and flashing

-damage showing on radar like a blurred red section, when getting hit(like in shooter games, all around red if just damage, right rotation if got hit by gun)

-in RACE gamemode hp & armor replaced with vehicle hp and speed(not implemented yet)

Round and Rectangular radar Areas

-full support for all rectangular radar area features

-brand new (!) circular radar areas

24lmzyu.png

functions(use exports.IVhud:functionName(args) ):

they works both clientside and serverside

element/boolean createRoundRadarArea(float x,float y,float radius,int r,int g,int b,int a) 
--[[ 
x and y: pos on the world 
radius: radius of area on the world 
r,g,b and a:4last args optional, the color of radar area(default:white, 150alpha) 
  
returns false if invalid args, element of "roundradararea" type if sucessful 
]] 

boolean/float float float roundRadarAreaDimensions(element area,float x,float y,float radius) 
--[[ 
sets and gets position and radius of specified area 
call it with only 1st argument to return pos and radius of area, call with all 4 to set them 
  
  

boolean/int int int int roundRadarAreaColor(element area,int r,int g,int b,int a) 
--[[ 
sets and gets radar area color 
call it with only 1st argument to return color, call with all 5 to set the color 
  
  

boolean isElementInRoundRadarArea(element theElement,element area) 
--[[checks is particular element inside the round radar area 
returns boolean 
  
  

  
boolean/table getElementsInRoundRadarArea(element area,string elemType) 
--[[ 
gets all elements in particula round radar area, filters them by type, if elemType specified. 
returns table(may be empty) or false if invalid arguments 
  
  

boolean/int int int int int string float float float roundRadarAreaFlashing(element area,int interval,int r2,int g2,int b2,int a2,sting easetype,float easeperiod,float easeamplitude,float easeovershoot) 
--[[ 
makes round radar area flash. 
interval: how long will the flash/interpolation go before reaching the edge 
r2,g2,b2,a2: second color for the flash, first being the normal one. 
easetype: any type of easing used for interpolation of colors 
  NOTE: "Binary" is aviable aswell-it just switches from color1 to color2 and back without easing. 
easeperiod,easeamplitude,easeovershoot: arguments for the easing, OPTIONAL 
to turn flashing off call it with only first 2 arguments. 
  
to return all arguments specified before(except area itself ofc) call it only with first argument.   
  
  

weapon/wanted/money hud:

-each weapon has own gtaIV style icon, and ammo displayed

-both money and weapon fades out if not used, just like in GTAIV

-"show all" key, shows all information and weapon even when they normally would be hidden

-money hud IV style, showing only when changing, also showing income/outcome(eg. -10000$)

-wanted stars, flashing if just changed, hidden if no wanted level

information hud(show it with num+ key):

-shows vehicle name

-shows zone name

-shows city name

-shows fps

-shows time

settings:

-resize/drag corresponding windows to change pos and size of components

-F3 to enter the settings mode

-resetting to default setting

-colour change tab for almost all colours in game

-tab to turn off particular parts

30ryayt.jpg

5123.jpg

help needed:

info about:

1)rate of oxygen decreasing

2)rate of oxygen increasing

3)effect with full oxygen skill

4)vehicle oxygen degrease rate

CREDITS:

32*32pixel very cool blips,few weapon icons,higher quality rings for the radar and many tips : Aibo

function for getting correct camera rotation and velocity effect on zoom : Talidan (customblips resource)

other weapon icons : Dre-+- (new_hud resource), el_motoblock, and Alexander Blade

Edited by Guest
Link to comment
  • Replies 170
  • Created
  • Last Reply

Top Posters In This Topic

help needed:

redesigning the ring pictures in higher quality(i suck at pic editing)

i can help with that. i also was making a round hud (but i went the other way with circular bars, half is just hidden so it just rotates pretty smooth and accurate), but got bored on making new weapon icons :D

btw what image sizes (in pixels) you're using?

Link to comment

help needed:

redesigning the ring pictures in higher quality(i suck at pic editing)

i can help with that. i also was making a round hud (but i went the other way with circular bars, half is just hidden so it just rotates pretty smooth and accurate), but got bored on making new weapon icons :D

btw what image sizes (in pixels) you're using?

im using 210x210 main ring, and 200x200sections of the hp

would be nice to get 1.5times more quality at least

and they have to be white so i can recolor then.

hmm, maybe i should also use that hiding techniques, not sure how to do that yet tough.

also, is there a way of getting air left when diving?

and btw that hud looks awesome

Link to comment

im using 210x210 main ring, and 200x200sections of the hp

also, is there a way of getting air left when diving?

it's a fact that images with sizes that are power of 2 (2^x, like 16x16, 32x32, 64x64, etc) work best with dx functions.

as for air im not aware of any way :/

Link to comment

im using 210x210 main ring, and 200x200sections of the hp

also, is there a way of getting air left when diving?

it's a fact that images with sizes that are power of 2 (2^x, like 16x16, 32x32, 64x64, etc) work best with dx functions.

as for air im not aware of any way :/

ok then make it 256x256 for both ring and hp masks(hp mask have to be centered inside the big ring)

and i think i found a way to avoid that bug with light borders-tested it with black, and it didn't make them, so ill draw background from the hp/armor color, then draw black over them.

thanks for effort.

Link to comment
Wow karlis! So this is why you want to take Dre's weapon icons huh? :P

I never managed to create a round DX element. How did you do that? I've always wanted to create something round, but I don't know how.

wait a week or two, and then watch the code :) (ill try commenting it for you :) )

EDIT: you can check this post, for a function for generating round thing out of dx rectangles

viewtopic.php?f=91&t=33267&start=15#p348435

Link to comment

So it needs a function to do so? Oh well.

I got to learn how to use that code to make a circle for something. Well still unplanned, but thanks! :D

AFAIK there's no such thing as set/getPedOxygen, though I requested it and not known if it is resolved.

Link to comment

thats how mine rings looks:

basically a 1 fat white ring with ~20pixel thickness on 210x210

and 9 10pixel thick white rings with dimensions 200x200, aligned that way their lines is in middle of big ring.

each next ring is half of prev one(rounded up.) e.g. 180degree section, then 90degree section

and their right side is aligned on top of the image

warning:in case they are antialiased, make sure .png doesn't cut half of aliasing off, or doesn't make bright edges of pic, so basically only way to implement proper antialiased image is with .dds, but afaik .dds has very big sizes of file.(correct me if i'm wrong)

proportions should stay pretty much same

another question:so for optimal draw, i should turn resolution based resizing off and put radius of 128 by default?

Link to comment

basically, if you're image is with correct sizes (2^x) and is not scaled — it will look best in dxDrawImage. sometime even scaling doesnt hurt. so PNGs with 8-bit alpha work fine if treated with care :D

as i recall DDS uses DXT compression (optional though). imo it'll make no difference in the end for dxDrawImage/Section

ps: correct me if im wrong:

ringsgif_6013359_2254328.gif

Link to comment

srry for double, but edits don't take any notice

progress update!

*made hp show up correctly also for higher HP stat setting(still need to find out how stats affect armor)

*now armor and hp refreshes 10times a second(should i lower it?) + onClientPlayerDamage, not every frame(found that being a unneeded lag)

*damage showing on radar like a blurried red section, when getting hit(like in shooter games, all around red if just damage, right rotation if got hit by gun)

*new HD(64*64)blips, no more ugly blurry blips from default SA(thanks to Cieran Douglas http://www.noe-version-2.com/ )

*blips can be marked with a text now.

by default text shows for vehicle and player attached blips, showing vehicle name or nick

can be changed by

setElementData(theBlip,"blipText",text,true) 
--3rd arg: nil=default, false=don't draw, string=your text 

having problems with scaling down yet tough.( viewtopic.php?f=91&t=33382 )

*now map correctly handle bounds of world(in cost of much bigger radar image size(currently 2.8mb image folder total))

*hp and armor drawing is now smoother

*hide key, for those who want to hide hud for screenshots/etc

119ownk.jpg

Link to comment

another progress update!

*switched to Aiboforcen's epic blips, from bigradar res.

*blip texts are fully working and functional!(gosh was so hard to make sure they don't go out of radar bounds)

*pickups are now displayed!

*zoom is now smooth fading in and out

*solution for blocky hp and armor is found.

rtneqo.jpg

Link to comment
Nice, can't wait for it :D Btw, will it be possible to move the HUD in any place of the screen ?

settings will come after a time(such as pos, size(propably), show pickups, color change, so on), but i feel boring for making a gui and then syncing all the vars, so i give no prior to that.

Link to comment

thanks for support

for those who are asking about settings, heres current list of variables, that can easy be changed, and most likeley will be in settings.

local minVel = 0.3 --velocity, from witch on radar zoom will go bigger 
local minDist = 180 --minimum radius of radar in meters, with zoom 1. 
local maxVel = 1 --at witch point maxDist will take effect 
local maxDist = 360 --[[maximum radius of map in meters, shown with 1 zoom, 
,if velocity of car is maxVel or higher.You can change it, bot dont make it any bigger.]] 
local minZoom = 1 --minimum changebale zoom 
local maxZoom = 3 --maximum changeable zoom 
local zoom=1 --default zoom 
local zoomPlus="=" --key to zoom in the radar 
local zoomMinus="-" --key to zoom out the radar 
local toogleHUDKey="num_mul" --key to toogle HUD 
local mapSize=4096 --dimensions of radar map included in res, change it if you change the map 
local sx,sy=guiGetScreenSize() --ovibious, dont change it. 
local size=110/924*(sy+100) --[[radius of radar, do this*1.3 to get actual radius of radar in pixels. 
Is affected by resolution.]] 
local x,y=size*1.5,sy-size*1.5 --position of center of hud on screen 
local dxSize=math.max(sy/1024,0.8 ) --size of blip texts, is affected by screen size 
local dxFont="arial" --font of blip texts 
local screenSizeCompensate=sy/500 --how much will blip size be affected by your resolution 
local blipDimension=16*screenSizeCompensate --default size blip dimension 
local textColor=tocolor(200,200,200,255) --default color of blip texts 
local backgroundCol=tocolor(0,0,0,160) --color of blip text background 
local hpCol=tocolor(20,90,20,255) --color of HP bar 
local armorCol=tocolor(10,50,100,255) --color of armor bar 
local ringCol=tocolor(30,30,30,255) --color of hud ring 
local inRingCol=tocolor(0,0,0,255) --color of armour & HP bar bakground 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...