The Infinity Blade Forums Have Moved

We've launched brand new Infinity Blade forums with improved features and revamped layout. We've also included a complete archive of the previous posts. Come check out the new Infinity Blade forums.
See more
See less

Canvas.Style to render texture???

  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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
      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
        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
          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
            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
              i need Canvas.DrawColor.A = 0 and Canvas.DrawTile()?


              • #8
                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;