Greetings, guys, i work on DeusEx Mankind Divided like menu with player info, map, client settings, list of installed augmentantions from my "huegmentacii (workname)" system ( concept:
https://www.youtube.com/watch?v=qV3FUxZG7lQ&feature=youtu.be
)
So i'd like to make DModelPanel with animated camera, as you read from title, for example you click on eyes and camera pos going to eyes, don't really know what func i have to use to make it, so asking you, guys, to help. Thank you, Happy New Year everybody
P.S: here is some screenshots:
https://imgur.com/a/SQl9pYT
Also could somebody advice me good way to rotate health, armor and hunger bars, you could see problem on second screenshot, i've tried to use some ways, but they work only with 3D2D (200 * -LerpHPFunction) but when i use it in 2d my bar disappears. But it's not big problem, i will solve it myself, the general question is on top of thread
You will have to make the animation system yourself, from scratch, as there isn't any built in systems for animating the camera in the DModelPanel.
Damn, i'l try to do without animation then: delete one dmodel and create another with another camera pos. Btw, is using Network Int's too much may cause problems?
Just set the camera position on the old one??
Don't really understand you, what you mean?
You are doing something wrong.
okay, i will check, thank you friend
So if someone interested by how way i made it, here it is
local function model()
if IsValid(mdl) then return end
BGPanel = vgui.Create( "DPanel" )
BGPanel:SetPos( 600, ScrH() * 0.17 )
BGPanel:SetSize( ScrW() * 0.4, ScrH() * 0.74 )
BGPanel:SetBackgroundColor( Color( 0, 0, 0, 0 ) )
BGPanel:MakePopup()
BGPanel.Paint = function(self, w, h)
end
mdl = vgui.Create( "DModelPanel", BGPanel )
mdl:SetSize( BGPanel:GetSize() )
mdl:SetModel( LocalPlayer():GetModel() )
local eyepos = mdl.Entity:GetBonePosition( mdl.Entity:LookupBone( "ValveBiped.Bip01_Head1" ) )
function mdl:LayoutEntity( ent )
ent:SetSequence( ent:LookupSequence( "run_lower" ) )
mdl:RunAnimation()
return
end
mdl:SetLookAt( eyepos )
if LocalPlayer():GetNWInt("campos") == 0 then
mdl:SetCamPos( eyepos-Vector( -14, 0, 0 ) ) -- Move cam in front of eyes
eyepos:Add( Vector( 0, 0, 2 ) ) -- Move up slightly
mdl.Entity:SetEyeTarget( eyepos-Vector( -12, 0, 0 ) )
elseif LocalPlayer():GetNWInt("campos") == 1 then
mdl:SetCamPos( eyepos-Vector( -14, 16, 0 ) ) -- Move cam in front of eyes
eyepos:Add( Vector( 0, 0, 2 ) ) -- Move up slightly
mdl.Entity:SetEyeTarget( eyepos-Vector( -12, 0, 0 ) )
elseif LocalPlayer():GetNWInt("campos") == 2 then
mdl:SetCamPos( eyepos-Vector( -20, -20, 15 ) )
eyepos:Add( Vector( 0, 0, -25 ) ) -- Move up slightly
mdl.Entity:SetEyeTarget( eyepos-Vector( -25, 10, 15 ) )
elseif LocalPlayer():GetNWInt("campos") == 3 then
mdl:SetCamPos( eyepos-Vector( -25, 0, 0 ) )
eyepos:Add( Vector( 0, 0, -25 ) ) -- Move up slightly
elseif LocalPlayer():GetNWInt("campos") == 4 then
mdl:SetCamPos( eyepos-Vector( -25, -35, 35 ) )
eyepos:Add( Vector( 0, 0, -40 ) ) -- Move up slightly
end
end
first of all i made a camposes depends from player's NWInt, and then i rebuild it in button click function
local EyesButt = vgui.Create( "DButton", AugPanel )
EyesButt:SetPos( ScrW() * 0.006, ScrH() * 0.05 )
EyesButt:SetText( "" )
EyesButt:SetSize( ScrW() * 0.12, ScrH() *0.098 )
EyesButt.Paint = function( self, w, h )
local x, y = self:LocalToScreen()
if self:IsDown() then
surface.SetDrawColor(colorwhite)
elseif self:IsHovered() then
hover2()
elseif not self:IsDown() and not self:IsHovered() then
surface.SetDrawColor(colorgray)
end
surface.DrawRect(0,0,w/7,h)
drawSpecialText("ГЛАЗА", "infomenuBoldSmall", -y+x + 7, x+y + 81, 1, 1, -90, Color(0,0,0,255))
end
EyesButt.OnCursorEntered = function()
surface.PlaySound( "hover.wav" )
end
EyesButt.DoClick = function()
surface.PlaySound( "open.wav" )
LocalPlayer():SetNWInt("campos", 0)
mdl:Remove()
BGPanel:Remove()
if not IsValid(BGPanel) then
model()
end
end
Check DModelPanel/SetCamPos
SetCamPos and SetLookAt
have a look at the post higher, i just posted solution if someone will find it useful
Sorry, you need to Log In to post a reply to this thread.