• Rendering text only SOME times...
    10 replies, posted
I am making an extention for E2, and its a holo-text extention, as in 3D2D, but the problem is that is renders only some of the time, and i cant understand the peramiters on which it DOES render... [URL="http://www.xfire.com/video/222f3f/"][IMG]http://video.xfire.com/222f3f-4.jpg[/IMG][/URL] Tell me what part of my code you need, because theres a lot of it. For starters, ill post my ENT:Draw() function [lua] function ENT:Draw() cam.Start3D2D(Info["Position"],Info["Angle"],Info["Scale"]) draw.DrawText(Info["Text"],"DefaultFixedOutline",0,0,Info["Color"],1) cam.End3D2D() end [/lua] All those are defined by: [lua] function ENT:Load() Str = self.Entity:GetNetworkedString("wire_textholo") Info = glon.decode(Str) end [/lua] and that is set by something in init.lua [lua] function ENT:send() print("sv_send called") self.Entity:SetNetworkedString("wire_textholo", glon.encode(Info)) end [/lua] and info is set by more functions in init.lua called by the E2 extention file. [editline]12:01PM[/editline] ...?
[B][URL="http://wiki.garrysmod.com/?title=ENT.UpdateTransmitState"]Oh[/URL][/B]
so ENT:PostDrawOpaque() instead of ENT:Draw()? With PostDrawOpaque() is just makes an error model at origin... That is by replacing ENT:Draw() with ENT:PostDrawOpaque()
[QUOTE=iRzilla;20287580]-snip- Not worth trying to explain to you.[/QUOTE] Whadya mean, i get it. with PVS it only sends if it changed, with ALWAYS it sends even if it hasnt changed. How was i to know that it had renderables in the end if its name? Also, thats a gamemode function... do i hook into it from the ent or something?
Fixed, so do i hook into it from the entity or something?
I did, but that would overwrite the function, and it has GM: instead of ENT: and i dont know if that means it can be made from the ent, or just hooked or something...? Thanks iRzilla! It works now :D [lua] function PostDrawOpaqueRenderable() if Go == 1 then cam.Start3D2D(Info["Position"],Info["Angle"],Info["Scale"]) draw.DrawText(Info["Text"],"DefaultFixedOutline",0,0,Info["Color"],1) cam.End3D2D() end end hook.Add("PostDrawOpaqueRenderables","textholohook",PostDrawOpaqueRenderable) [/lua]
Sorry, you need to Log In to post a reply to this thread.