Sign in to follow this  
xlad

DX9 Sprites and Text

Recommended Posts

Is it possible to render a texture on a sprite so it is stretched or tiled?

I searched around and only found out that sprites can be stretched by setting a transformation matrix which has a scale "set in it" (D3DXMatrixTransformation2D).

But is there a way to do the tiling (like having a very small desktop background on a very high resolution with the position = tiled, like the windows' desktop background)? or i must use a "for/while" to draw the tiles my self?

I'm wondering how to implement the GUI for a game.
http://www.youtube.com/watch?v=elJYd_Br_F8
In this video, the "single color" windows are drawn with a stretched texture which is like 64 x 64 and contains only one color?
Or how did he implement the drawing part of the GUI ?



I learned using sprites from here http://www.toymaker.info/Games/html/sprites.html , maybe there are other similar sites?




Also, if i use ID3DXFont to draw text of the buttons/windows of my GUI, the text won't be drawn on top of everything else right?
Let's say i have 2 buttons, one small and one large. Both have a caption, and i draw them in this order : the small button first, then the caption of the small button, then the large button and finally the caption of the large button. If the large button is on top of the small one, covering it completely, the small button's caption won't be visible right?



I haven't started writing the GUI part of my game, but i want to get some good advice to make it fast enough and well organized before i start.

Share this post


Link to post
Share on other sites
Quote:
Original post by xlad
Not full screen sprites, i wonder if it is possible to draw with a single call like this.
http://img152.imageshack.us/img152/1707/tiledg.png
sounds like you want the Wrap Texture Address Mode. then just draw a quad the size of the area to tile, with the sprite to be tiled as the set texture.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this