render.SetViewPort

From GMod Wiki

Jump to: navigation, search
Function
Syntax render.SetViewPort( Number x, Number y, Number width, Number height )
Where is this used?
Description:
Sets the current viewport position and size, then you can render a target. This is similar to the players normal screen.
Returns: nil
Part of Library: render
Realm: NewerClient.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Render.SetViewPort]Render.SetViewPort [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionRenders a screen with a dimention of 32 X 32 and resets the render system to normal.
Used onNewerClient.png
Code
local oldRT = render.GetRenderTarget()
	render.SetRenderTarget(RTName)
	render.Clear(0,0,0,255)
	render.SetViewPort(0,0,32,32)
	render.RenderView(CamData)
	render.SetRenderTarget(oldRT)
	render.SetViewPort(0,0,ScrW(),ScrH())
OutputN/A

Additional Notes

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox