somebody1997 Posted April 16, 2012 Share Posted April 16, 2012 (edited) Hello, Pls help me with my problem. I want that when i open my window that it goes to a specific view. This works fine, but now the problem. When i want that the view returns to the player then it dont work. Can someone help me, pls? function dxCreateNewsWindow () dxDrawImage(369.0,135.0,607.0,433.0,"background.png",180.0,0.0,0.0,tocolor(50,50,50,255),false) dxDrawImage(369.0,170.0,607.0,410.0,"background.png",180.0,0.0,0.0,tocolor(255,255,255,255),false) dxDrawText(" VG",375.0,139.0,905.0,165.0,tocolor(0,221,255,255),1.0,"bankgothic","left","center",false,false,false) dxDrawText("The - News.",375.0,139.0,905.0,165.0,tocolor(90,90,90,255),1.0,"bankgothic","left","center",false,false,false) dxDrawText(newsText,406.0,201.0,942.0,547.0,tocolor(255,255,255,255),1,"clear","left","top",false,false,false) end function createViewOpen () setCameraMatrix(1468.8785400391, -919.25317382813, 100.153465271, 1468.388671875, -918.42474365234, 99.881813049316) end local back = getCameraMatrix() local localPlayer = getLocalPlayer () function backToView () setCameraTarget() end local shown = false function showNewsWindow() if shown == false then addEventHandler("onClientRender", root, dxCreateNewsWindow) addEventHandler("onClientRender", root, createViewOpen) shown = true else shown = false removeEventHandler("onClientRender", root, dxCreateNewsWindow) addEventHandler("onClientRender", root, backToView) end end Edited April 16, 2012 by Guest Link to comment
TAPL Posted April 16, 2012 Share Posted April 16, 2012 setCameraTarget() setCameraTarget(localPlayer) and remove this addEventHandler("onClientRender", root, backToView) addEventHandler("onClientRender", root, createViewOpen) and this not needed local localPlayer = getLocalPlayer () Link to comment
somebody1997 Posted April 16, 2012 Author Share Posted April 16, 2012 but when i do that it goed back to the player but then the camera does really weird. You cant move around the player with mouse. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now