--
[ Picked text/plain from multipart/alternative ]
Another, easier way is with a render target.

Initializing:

- Create a render target texture of the size you need (derive
CBaseClientRenderTargets, you have to init a render target at the right
time), call it something like _my_rt0

Drawing:

- Use SetRenderTargetAndViewPort to set the render target and view area
- Clear the render target
- Paint a vgui control or several vgui controls (call Paint/PaintTraverse or
something manually) or, use surface->Draw*
- The render target now contains whatever vgui painted, and you can
reference it in a .vmt using $basetexture "_my_rt0".

The way Mike suggested hasn't really worked for me, I had problems trying to
get the procedural texture to work. This way is somewhat easier if you just
want to draw text the way vgui does. If you need to upload text where you
already have the raw image data then use the procedural texture. Likewise if
you wanted to read image data from a video decoder or unsupported image
format.

Regards,

Paul

On Nov 15, 2007 1:19 PM, Janek <[EMAIL PROTECTED]> wrote:

> --
> [ Picked text/plain from multipart/alternative ]
> Thx Mike. I'll read that again and again. At the moment I don't understand
> everything. I hope I can write text using this method but I'm not sure.
>
> 2007/11/15, Mike Durand <[EMAIL PROTECTED]>:
> >
> > Try this:
> >
> > http://developer.valvesoftware.com/wiki/Procedural_Materials
> >
> > -----Original Message-----
> > From: [EMAIL PROTECTED]
> > [mailto:[EMAIL PROTECTED] On Behalf Of Janek
> > Sent: Thursday, November 15, 2007 7:45 AM
> > To: [email protected]
> > Subject: [hlcoders] Dynamically creating material including text
> >
> > --
> > [ Picked text/plain from multipart/alternative ]
> > Hi all,
> >
> > I would like to know if it is possible to dynamically create a
> > clean IMaterial (client side only) in which I write some texts which can
> > be
> > an argument like "My text" or whatever.
> > I know the materials->FindMaterial( name, group ) which is using an
> > exisiting material. What I want is to create my own one dynamically coz
> > I
> > don't know what text will be in this material.
> >
> > Any idea ?
> > --
> >
> > _______________________________________________
> > To unsubscribe, edit your list preferences, or view the list archives,
> > please visit:
> > http://list.valvesoftware.com/mailman/listinfo/hlcoders
> >
> >
> > _______________________________________________
> > To unsubscribe, edit your list preferences, or view the list archives,
> > please visit:
> > http://list.valvesoftware.com/mailman/listinfo/hlcoders
> >
> >
>
>
> --
> -------------------
> [EMAIL PROTECTED]
> --
>
> _______________________________________________
> To unsubscribe, edit your list preferences, or view the list archives,
> please visit:
> http://list.valvesoftware.com/mailman/listinfo/hlcoders
>
>
--

_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders

Reply via email to