AggrorJorn Posted August 12, 2012 Share Posted August 12, 2012 I am wondering if I can display a part of an image or making a part opague with using Leadwerks commands. I am displaying a background image which has a weird shape. Then I want to display a toplayer image but only a specific amount depending on a percentage. Any idea how I can do this? Quote Link to comment Share on other sites More sharing options...
shadmar Posted August 12, 2012 Share Posted August 12, 2012 Using drawimage()? Do drawimage use any shaders? Quote HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB Link to comment Share on other sites More sharing options...
Road Kill Kenny Posted August 12, 2012 Share Posted August 12, 2012 Using drawimage()? Do drawimage use any shaders? Pretty sure it doesn't. I think draw image is just plonked on the top of the rendered image once al shaders have been applied. Quote STS - Scarlet Thread Studios AKA: Engineer Ken Fact: Game Development is hard... very bloody hard.. If you are not prepared to accept that.. Please give up now! Link to comment Share on other sites More sharing options...
macklebee Posted August 13, 2012 Share Posted August 13, 2012 DrawImage only scales the texture based on what dimensions you provide. To draw parts of texture, you can either use raw opengl commands like shown in masterxilo's opengl tut or you can just use LE commands. LE commands: 1) Create a separate buffer 2) Draw your image oversized to that buffer using the position and scaling to determine how much is shown in the buffer 3) Use GetColorBuffer on that buffer and draw it on your screen Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
AggrorJorn Posted August 13, 2012 Author Share Posted August 13, 2012 thanks for the help macklebee. Quote Link to comment Share on other sites More sharing options...
Daimour Posted August 13, 2012 Share Posted August 13, 2012 There is a little example here: http://www.leadwerks.com/werkspace/topic/4746-load-texture-pieces/#entry41584 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.