The0neThe0nly Expert Cheater Reputation: 0
Joined: 08 Dec 2009 Posts: 119 Location: In a box
|
Posted: Thu Jul 19, 2012 12:07 am Post subject: How do I use rasterimage_setTransparentColor? |
|
|
Hey, I want to put a transparent solid blue rectangle behind my text as a background. However, I looked in main.lua and I'm not completely sure the usage of rasterimage_setTransparentColor.
Code: | background=createPicture()
bmp=picture_getBitmap(background);
graphic_setHeight(bmp,1)
graphic_setWidth(bmp,1)
c=rasterimage_getCanvas(bmp)
rasterimage_setTransparentColor(bmp, 0xCD0000)
canvas_setPixel(c,0,0,0xCD0000)
d3dhook_initializeHook()
bgtexture=d3dhook_createTexture(background)
bgsprite=d3dhook_createSprite(bgtexture);
d3dhook_renderobject_setX(bgsprite, 0)
d3dhook_renderobject_setY(bgsprite, 280)
d3dhook_sprite_setWidth(bgsprite,200)
d3dhook_sprite_setHeight(bgsprite,200) |
|
|
Dark Byte Site Admin Reputation: 458
Joined: 09 May 2003 Posts: 25287 Location: The netherlands
|
Posted: Thu Jul 19, 2012 3:52 am Post subject: |
|
|
Transparent color means that when that specific color is drawn to the bitmap, it won't be draw, but marked as an fully transparent pixel (100%)
what you want to use is d3dhook_renderobject_setAlphablend.
0.0=invisible
1.0=fully visible
0.5=50% visiblility
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|