Search Forums
-
I agree with you David, it is not the right way. I already showed the right way, but they asked for an alternative, so I gave one :p
-
Something along these lines:
graphicsDevice.VertexDeclaration = vertexDeclaration;
...
-
This is a hungry forum, it eat's too many posts :(
Can you explain what effect you want more precisely?
Isn't the point of transparency to be able to see through and therefor see objects behind? Which seems to me to be exactly what you are getting with the second picture.
Have you tried drawing front to back with the depth ...
-
Do you know how to create and draw a cube without using the Model class?
You need:
A VertexDeclaration object - probably VertexPositionNormalTexture
A BasicEffect object
A VertexBuffer
Fill the VertexBuffer with 36 vertices, 6 for each face (2 triangles)
Set the normals and UV's.
Then when drawing, draw each face ...
-
RenderTarget is the only way. But have you profiled it? I doubt the RenderTarget resolve (should only be done once) and the SpriteBatch draws take any time at all.
Is it still slow if you render the picture directly to the backbuffer, without the RenderTarget/SpriteBatch stuff?
Should be something like:
Draw Picture To ...
-
Just define your Draw method on the MoveableObject class as virtual then use the override keyword on the subclass, then the sublcass Draw method will be called.
There are no pure virtual methods in c# - the abstract keyword is used instead. You can use the abstract keyword if you want instead of virtual. The difference is abstract methods ...
-
[quote user="ERiba"]Except I wouldn't use the Drawable G.C. but his abstract base class and I wouldn't post something so simple he could code in 1-2 minutes. Cmon how long did it take you to do that? :-)
[/quote] It took me 5 minutes, but the OP is learning, and seems to be struggling, so it might help.
-
Here is what ERiba is talking about, and I agree, it is a better way because you have control.
[Edited]
class Tile : DrawableGameComponent
{
...
-
[quote user="test84"]I create my tiles and characters after reading their placement from my map file, which I read from a text file. So whenever I reach that I have to create an enemy, I call game.Components.Add(tempEnemy); to add that component to the collection, but obviously they don't get a draw call.[/quote] What do you mean ...
-
It should be located in:
'C:\\Users\\Emmanuel\\Documents\\Visual Studio 2008\\Projects\\XNA_Learning_001\\XNA_Learning_001\\bin\\x86\\Debug\\Content\\Sprites\\background.xnb'
Where is the file in the Solution explorer, under the Content Folder?