Jump to content
  • Advertisement
Sign in to follow this  
underthesun

best way to draw a rounded rectangle with tiled pattern..

This topic is 3153 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I need to draw a rounded rectangle with a striped pattern inside it. My current strategy is to have a circle .gif and stretch it appropriately (as in, stretch the middle part long so the edges retain the original size). Those look like this: http://imgur.com/6Mjwx Now, after drawing that with alpha testing, we'd have a rounded rectanglish shape on the depth buffer. I then would print a square with tiles to cover the whole area and by utilising the depth buffer I can confine the drawn area to the shape inside that rectangle. Does this sound good, or is there a better way? alpha testing is actually a bit slow in the platform I'm developing for (iPhone) so yeah..

Share this post


Link to post
Share on other sites
Advertisement
You could use multitexturing to achieve this result in a single pass. Simply bind your tiled square as your second texture and use secondary texture coordinates. If you are not using shaders, I believe these will be automatically modulated (i.e. the values are multiplied at range [0, 1]) to produce the result you are loooking for.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!