Hello, I'm creating a console screen with cam.3d2d()
Everything is going quite well up until this point.
The 1st screen is finished and I am welding a new prop to the entity to create another screen.
Upon creating the cam screen on top of this new prop the cam renders behind the entity even though it is positioned in front of the prop.
I solved this issue on the entity itself by calling self:DrawModel() before the cam code.
I have available in the cl_init file the prop's entity and attempted to override the draw function like so:
[code]local CenterScreen = self:GetCenterScreen()
function CenterScreen:Draw()
--Override Props Draw Function?
end[/code]
Which had no effect..
Any suggestions here? I don't want to have to create a new entity for each screen I'm trying to attach to the main entity to reduce complexity.
Can you show a picture of what is happening?
[IMG_THUMB]http://cloud-4.steampowered.com/ugc/594759049903287132/A69B9B5118AEB179D6614FAB702AB2EDC2E3F1E1/[/IMG_THUMB]
The cam is positioned in front of the plate yet any models draw on top of it
Do you mind if I, well you, add me on steam? my usename is kklouzal
The problem may be you have it in a rendering hook that is rendered before those objects. Try a different rendering hook to see if that fixes the issue.
I can't add anyone right now, I'm at my brothers company working on my 50cc, and I don't see why you want to add me. Anyway it's a bit dark, but it doesn't really look as if the screen is parallel to the surface of the prop. Also, what hook are you drawing it in?
I tried it in DrawTranslucent, which didn't work. I don't know of any others aside from using PostDrawOpaqueRenderables which is very costly.. There must be a way to override the prop_physics ENT:Draw() function?
EDIT: It is in front of the prop. I've made sure of it.
Sure it's in front of the prop, but it should be parallel to the surface that you are placing it on or it's gonna stick through like on the picture (from what I can see, as I said, it's dark).
[editline]9th August 2013[/editline]
And yea it's possible to override ENT:Draw(), it's called a detour:
[lua]
local OldDraw = ENT.Draw
function ENT:Draw()
OldDraw()
ScreenDraw()
end
[/lua]
How would I stick that inside another entity's draw function? I basically want to remove the prop_physics draw function, I tried this:
[code] local CenterScreen = self:GetCenterScreen()
local OldDraw = CenterScreen.Draw
CenterScreen.Draw = function()
--do nothing
end
CenterScreen:DrawModel()[/code]
and
[code] local CenterScreen = self:GetCenterScreen()
local OldDraw = CenterScreen.Draw
function CenterScreen:Draw()
--do nothing
end
--CenterScreen:DrawModel()[/code]
I'm trying to completely control the prop_physics draw function from within my entities draw function
Wait, are you trying to detour the ENT:Draw() function on [I]every[/I] prop_physics on the server?
Sorry, you need to Log In to post a reply to this thread.