Dokumentation[älter]
-----------DOCUMENTATION---------------
EGP Documentation.
What is EGP?
EGP is an entity screen to be used with e2.
What can EGP do?
EGP can draw lines shapes and text.
How do I wire egp?
Simply wirelink it to an e2 chip.
What is an element?
An element is something your drawing like a box or a line or some text.
Each element has an index. (Just like holos.)
There is a server cvar that limits how many elements an egp can have.
"sbox_maxwire_egp_elements"
max elements default is 40.
What elements can I draw?
There are a few:
Box
Boxoutline
Line
Text
Circle
CircleSpecial.
WTF is a circle special?
It?s a normal circle that has had its draw information changed.
You can change the numsides to 3 and get a triangle.
You can set the start and end angles (between 0 - 7) to make semi circles.
What?s the max fps of EGP?
That depends, its actually 12 FPS.
BUT the more elements you have waiting to draw the lower the fps.
What?s the screen size?
512 by 512
THAT SUCKS?
narp what realy sucks is LAGGGGGGGGGGGG!
And this way we don't get lag.
Ok so what e2 functions do I use?
Look at the function list.
Basics.
When you create or edit or remove an element on the egp you?re changing the element cache.
The egpDraw() function will then process the element cache on the screen, this is why you call this last.
egpClear() will totally clear the cache.
Note: egpDraw() does not clear the cache, so you only have to create an element once.
If you create 2 elements at the same index the one you created last will be the one EGP draws.
ALWAYS USE EGP DRAW LAST!
Also you can write several elements to the EGP over several executions before calling egpDraw().
------------FUNCTION LIST----------------
XWL:egpClear -> Clears the cache.
XWL:egpDraw() -> Draws the cache onto the screen. (Returns 1 if successful 0 if not.)
XWL:egpRemove(idx) -> Removes element on next draw.
XWL:egpCanDraw() -> returns 1 if the EGP can draw on that exicution, 0 if not.)
XWL:egpDrawMaterials() Update the screen textures only. *OFFICAL EGP SVN ONLY!
Box -> draw a 4 sided box.
XWL:egpBox(idx,posX,posY,SizeX,SizeY,R,G,B,A)
XWL:egpBox(idx,vec2 pos,vec2 size,vec4 color)
XWL:egpBox(idx,vec2 pos,vec2 size,vec color,A)
XWL:egpAngle(idx,ang) -> Only works on box elements.
Boxoutline - > draw a 4 sided box with an outline.
XWL:egpBoxoutline(idx,posX,posY,SizeX,SizeY,R,G,B, A)
XWL:egpBoxoutline(idx,vec2 pos,vec2 size,vec4 col)
XWL:egpBoxoutline(idx,vec2 pos,vec2 size,vec col,A)
Line -> draw a line between 2 points.
XWL:egpLine(idx,X1,Y1,X2,Y2,R,G,B,A)
XWL:egpLine(idx,vec2 pos1,vec2 pos2,vec4 col)
XWL:egpLine(idx,vec2 pos,vec2 pos2,vec col,A)
Text -> write text.
XWL:egpText(idx,string text,vec2 pos,vec color,A)
XWL:egpText(idx,string text,vec2 pos,vec4 color)
XWL:egpText(idx,string text,pos1X,pos1Y,R,G,B,A)
XWL:egpTextLayout(id,string,vec2 pos,vec2 size, vec4 color) -> SUPPORTS \n and wraps text.
XWL:egpSetText(idx,string text)
XWL:egpSetFont(idx,font,size)
XWL:egpFontAlign(idx,x,y) -> veticle and horizontal alignment (0/1/2)
Triangle -> draw a triangle made up of 3 points.
XWL:egpTriangle(idx,X1,Y1,X2,Y2,X3,Y3,R,G,B,A)
XWL:egpTriangle(idx,vec2 Pos1,vec2 pos2,vec2 pos3,vec color,A)
XWL:egpTriangle(idx,vec2 Pos1,vec2 pos2,vec2 pos3,vec4 color)
Circle -> draw a circle.
XWL:egpCircle(idx,posX,posY,SizeX,SizeY,R,G,B,A)
XWL:egpCircle(idx,vec2 pos,vec2 size,vec4 col)
XWL:egpCircle(idx,vec2 pos,vec2 size,vec col,A)
Special Circle functions:
These will make the circles change shape rotation (etc).
XWL:egpCircleStart(idx,N) -> set the start angle (0-7).
XWL:egpCircleEnd(idx,N -> set the end angle (0-7).
XWL:egpCirclePoints(idx,vec2) -> start/end angles.
XWL:egpCirclePoints(idx,start,end) -> start/end angles.
XWL:egpCircleSides(idx,N) -> set the amount of sides the shape has (3-64).
Polys:
XWL:egpPoly(idx,array) -> creates a poly based on an array of 2d and 4d vectors.
XWL:egpPoly(idx,array,vec4 color) -> creates a poly based on a list of 2d and 4d vectors.
XWL:egpPoly(idx,array,vec color,alpha) -> creates a poly based on a list of 2d and 4d vectors.
Other:
XWL:egpMaterial(idx,material)
XWL:egpMaterialFromScreen(N,XWL/E) which takes the material from a GPULib RT screen (EGP, GPU, digital screen, console screen, text screen, oscilloscope)
XWL:egpPos(idx,posX,posY)
XWL:egpPos1(idx,posX,posY)
XWL:egpPos2(idx,posX,posY)
XWL:egpSize(idx,posX,posY)
XWL:egpPos(idx,vec2 pos)
XWL:egpPos1(idx,vec2 pos)
XWL:egpPos2(idx,vec2 pos)
XWL:egpSize(idx,vec2 pos)
Fonts:
coolvetica
arial
lucida console
trebuchet
courier new
times new roman