|
-
Nov 19th, 2011, 02:35 AM
#16
Thread Starter
Addicted Member
Re: [RESOLVED] DirectX - Rotated Text?
Yes that is a better way of exiting the main loop. I thought of an even simpler method - put the doevents at the end of the loop and it will run fine.
What is inside the main loop every time the array is filled Vertex_List(), if it can be done once at initialization?
Well this is a very basic example. In a game the text would be moving and/or (as i intended it) rotating.
Why use a very slow creation of textures, using a file, if I gave an example fast creation with GetDIBits? Also, write to the file causes an error when you run the program on a CD or flash drive with a blocked writing.
I would absolutely love to use your method!!! The problem is that using your example i have no clue of how to control where it's drawn. Look at these two examples:
Code:
D3DXMatrixLookAtLH Mtrx, vec3(0, 0, -5), vec3(0, 0, 0), vec3(0, 1, 0)
Dev.SetTransform D3DTS_VIEW, Mtrx
D3DXMatrixPerspectiveFovLH Mtrx, pi / 3, ScaleHeight / ScaleWidth, 1, 10
Dev.SetTransform D3DTS_PROJECTION, Mtrx
D3DXMatrixRotationZ Mtrx, Timer * 0.25
Dev.SetTransform D3DTS_WORLD, Mtrx
\\\\\\\\
Vertex_List(0) = Create_TLVertex(0, 0, 0, 1, D3DColorRGBA(255, 255, 255, 0), 0, 0, 0)
Vertex_List(1) = Create_TLVertex(100, 0, 0, 1, D3DColorRGBA(255, 255, 255, 0), 0, 1, 0)
Vertex_List(2) = Create_TLVertex(0, 0, 0, 1, D3DColorRGBA(255, 255, 255, 0), 0, 0, 1)
Vertex_List(3) = Create_TLVertex(100, 0, 0, 1, D3DColorRGBA(255, 255, 255, 0), 0, 1, 1)
Yours is using matrices and other methods of drawing while the other is simple. With the second one(the one i like a lot more) you can set the exact point(X, Y) in pixels, where each corner of the texture will be drawn. As far as i see it this gives the most simplicity and best control.
I would be really happy if you remake your example so that instead of using matrices each corner of the text is specified in X and Y.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|