Jump to content

Drawing a flat, specific part of a texture


Ruki
 Share

Recommended Posts

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

Link to comment
Share on other sites

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

 

 

buttonGUI_0.png

Link to comment
Share on other sites

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.

 Share

×
×
  • Create New...