PDA

View Full Version : Canvas.Style to render texture???



Antonio
12-12-2007, 10:56 PM
I wanna draw a translucend texture, but i seems that Canvas class don't have more the Style, anyone know how to draw a texture traslucent, like style=3 in Unreal Engine 1 or 2

In UE 1 and 2

Canvas.Style=STY_Translucent; or Canvas.Style=3;

In UE3?

Bonehed316
12-12-2007, 11:27 PM
You need to use DrawMaterialTile instead, and set the Materials BlendMode to be translucent.

Keep in mind, when rendering on the canvas, only the Emissive and Opacity values are valid.

bushbomb
12-14-2007, 09:23 AM
I had used Canvas.Style for drawing text, how should I update that for UT3?

I wouldn't use DrawMaterialTile for text, or would I?

Pfhoenix
12-14-2007, 09:46 AM
No, text rendering hasn't changed at all (to include font support, for better or worse).

Also, for rendering textures, you do not, in fact, need a material :

1) Create a texture with an alpha channel (I use TARGA .tga format)
2) Import your texture into a texture package
3) In your code, call Canvas.DrawTile()

The thing to play with is Canvas.DrawColor.A. Setting the alpha channel will affect how transparent your texture shows up as.

bushbomb
12-14-2007, 09:48 AM
No, text rendering hasn't changed at all (to include font support, for better or worse).

But Canvas.Style is not there anymore. I was asking how I do it now. All I used the canvas for in 1 mod was to write text, and I would change the Style of the Canvas depending on some conditions.

Pfhoenix
12-14-2007, 10:00 AM
You don't need it. The "style" is determined by the texture itself. You can't have a color-keyed texture any more. You need to create textures with alpha channels for masking.

You only have two options :
1) Do as I wrote
2) Do as Bonehed wrote

My method negates the need to have materials that you won't otherwise use. Bonehed's method allows you to do fancy processing on a texture before rendering it.

Antonio
12-15-2007, 10:32 PM
i need Canvas.DrawColor.A = 0 and Canvas.DrawTile()?

pingfreak
12-20-2007, 07:20 PM
use this..

H.Canvas.DrawColor.R = 255;
H.Canvas.DrawColor.G = 255;
H.Canvas.DrawColor.B = 255;
H.Canvas.DrawColor.A = 0;

you want transparent green? use this..

H.Canvas.DrawColor.R = 0;
H.Canvas.DrawColor.G = 255;
H.Canvas.DrawColor.B = 0;
H.Canvas.DrawColor.A = 130;