Ruki Posted October 16, 2012 Share Posted October 16, 2012 I'm currently porting over my existing game structure into Leadwerks engine and I'm having trouble on how to draw a flat 2D texture with specific UV coordinates. That is, rendering a specific part of a texture onto the screen. This is for my GUI elements. I can only find DrawImage, which seems to work, but will only draw the entire texture, and not specifically a portion of the texture. Should I be using some other function? Thank you DrawImage(texture, 50, 50, 200, 400); Do I have to use some OpenGL commands? I've previously achieved this in DX9 by drawing a trianglestrip and passing in the UV coordinates Sorry if this is a dumb question. Thank you Quote Link to comment Share on other sites More sharing options...
Ruki Posted October 16, 2012 Author Share Posted October 16, 2012 I'm not sure If i made myself clear, I want to be able to draw seperate GUI elements that are stored in one texture. I know how to convert the x/y pixel coordinates into UV floats, I just don't know which function I should be using in Leadwerks to render it. Thanks Quote Link to comment Share on other sites More sharing options...
macklebee Posted October 16, 2012 Share Posted October 16, 2012 see here and here. 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...
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.