Jump to content

Alpha Image?


Go to solution Solved by macklebee,

Recommended Posts

Posted

 

I need to draw the face of the character on the screen, although in corel draw I set a mask for the image, in leadwerks you see the whole image, some suggestio

image.png.a60d236715f43cf14d5c64043792a2af.png

 

 

Astrocuco.thumb.png.c76e0fb3de2d6e437e7dca099625e11e.png

Murphy's Law: We don't fix bugs, we document them as features. – Murphy Games

  • Solution
Posted

DXT1 compression does not store alpha. DXT3 will show alpha - but its all or nothing. DXT5 will show alpha in a full gradient from 0 to 1. Uncompressed texture will also show the alpha and is best for a GUI image.

Read the documentation on compression as this information is available: 

https://www.leadwerks.com/learn?page=Tutorials_Editor_Textures

  • Upvote 2

Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590

LE / 3DWS / BMX / Hexagon

macklebee's channel

Posted
4 minutes ago, macklebee said:

DXT1 compression does not store alpha. DXT3 will show alpha - but its all or nothing. DXT5 will show alpha in a full gradient from 0 to 1. Uncompressed texture will also show the alpha and is best for a GUI image.

Read the documentation on compression as this information is available: 

https://www.leadwerks.com/learn?page=Tutorials_Editor_Textures

Well, I've already got transparency in the editor, but it doesn't come out in the game with transparency. 


Edit: Script: 
 

function Script:PostRender(context)
    
    
    context:DrawImage(self.imgHudPlayer,context:GetWidth()-200, context:GetHeight()-200,200,200)

end



image.thumb.png.7054b1b6d618be8c96866e7b169679f4.png

 

 

Astrocuco.thumb.png.c76e0fb3de2d6e437e7dca099625e11e.png

Murphy's Law: We don't fix bugs, we document them as features. – Murphy Games

Posted
function Script:PostRender(context)
	context:SetBlendMode(Blend.Alpha)
	context:DrawImage(self.imgHudPlayer,context:GetWidth()-200, context:GetHeight()-200,200,200)
	context:SetBlendMode(Blend.Solid)
end

 

  • Like 1

Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590

LE / 3DWS / BMX / Hexagon

macklebee's channel

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...