Sprite top- and bottom-end fades out with RenderStretch
  • drowneathdrowneath July 2011
    Hi,

    I was trying to RenderStretch a sprite on the screen with the code below but I didn't get the result I expected.
    1
    2
    3
    hgeSprite *spr;
    //...
    spr = new hgeSprite(tex, 0, 0, 28, 7);


    Image: (28x7 24bit png)
    image
    1
    spr->RenderStretch(10, 10, 38, 150);


    Result:
    image

    I was expecting a 28x140 rectangle filled with solid red color all over it.
    Did I missed something?

    Thanks.
  • AzureBlazeAzureBlaze July 2011
    DirectX will try to interpolate images while enlarging, thus the gradient.
    You can turn this off while needed by turning system state HGE_TEXTUREFILTER to false.
    If you only need to render a rectangle, Gfx_RenderQuad might be better. Or, try using bigger image.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In Apply for Membership

In this Discussion

Who's Online (0)