Results 1 to 8 of 8

Thread: Canvas.Style to render texture???

  1. #1
    Antonio
    Guest

    Canvas.Style to render texture???

    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?

  2. #2
    Bonehed316
    Guest
    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.

  3. #3
    bushbomb
    Guest
    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?

  4. #4
    Pfhoenix
    Guest
    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.

  5. #5
    bushbomb
    Guest
    Quote Originally Posted by Pfhoenix View Post
    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.

  6. #6
    Pfhoenix
    Guest
    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.

  7. #7
    Antonio
    Guest
    i need Canvas.DrawColor.A = 0 and Canvas.DrawTile()?

  8. #8
    pingfreak
    Guest
    use this..
    Code:
    	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..
    Code:
    	H.Canvas.DrawColor.R = 0;
    	H.Canvas.DrawColor.G = 255;
    	H.Canvas.DrawColor.B = 0;
    	H.Canvas.DrawColor.A = 130;

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •