|
-
May 2nd, 2007, 02:53 PM
#1
Thread Starter
Frenzied Member
[2005] DirectX Questions
Answer 1, 2, none, or whatever! Any input is loved!
1) Be it VB .Net or C#, I am using C#, when I use a TextureLoader to create a texture, the Texture is compressed and looks horrible, and sometimes the file even changes size. Looks like a horribly compressed JPEG.
However, if I create a Bitmap object, load the file into it, and create a Texture from the Bitmap object, it looks perfectly fine. However, this makes me create a BMP variable. Is there a way to keep using TextureLoader but keep the Bitmap looking normal?
2) I know that when I am drawing a Sprite, I can draw only a portion of the Texture using a Rectangle object, but how can I have it so that I can CREATE a Texture object from only a portion of a Bitmap? Code example please 
3) Do I really need a Sprite object for everything? It seems all they are is an object that relates to the Device, not texture or anything. Could I just have a global Sprite variable and keep constanly Starting and Ending it? Why have a Sprite variable for every single Texture and Bitmap in your game? Because when you do that, it eventually ends up like this:
Code:
sprBullet = new Sprite(device);
sprLives = new Sprite(device);
sprEnemy01 = new Sprite(device);
sprProjBomb = new Sprite(device);
sprBomb = new Sprite(device);
sprExplosion = new Sprite(device);
4) When playing a Sound with a SecondaryBuffer with DirectSound like this:
Code:
DirectSound.Device soundDevice = new DirectSound.Device();
soundDevice.SetCooperativeLevel(this, DirectSound.CooperativeLevel.Normal);
soundLaser = new DirectSound.SecondaryBuffer("laserfire.wav", soundDevice);
soundLaser.Play(0, DirectSound.BufferPlayFlags.Default);
I play the sound in the MouseClick EventHandler, but when I click really fast, sometimes it skips. Is there any way to play the Sound from the beginning right when I click? If I click to fast it plays the sound, waits till it's done, and then you can play a new sound. I would prefer if it played again when I clicked whether or not the previously played sound is complete or not.
5) There are Sprite Maps, and Texture maps, but are there also Sound Maps? Like have one SecondaryBuffer and one WAV with lots of sounds in it, and play parts of the file to parts of the file. Probably not probable or plausible or even ethical but it's worth knowing.
6) Controls? I'm still looking on how to draw Textboxes and Buttons onto the screen in Full Screen Mode. I need to have Textboxes and a Button for my login screen for a game I am making with DX but I need to know how to draw controls onto the screen neatly.
7) Is there an easier way to check if an event has occured rather than, in the Render Function, use a foreach with the Bullets Class and the Enemies class and see if they have collided or not? Checking every single time possible doesn't seem too speed-efficient. I know I should use properties, but there are two classes that are colliding? I know I should put some sort of if statement in the set statement of the X and Y property in Bullets and Enemies, but how can I link them? Is it even possible?
8) Is there any other way to make a Texture transparent besides making a Bitmap Object, and passing the bitmap directory as a parameter, then calling the bitmap object and using the MakeTransparent property of the bitmap, and THEN create a texture out of that bitmap? It would probably be easier if I could use some sort of TextureLoader to load the bitmap automatically into the Texture and making it transparent with the color black or purple or whatever color the background color of the image is.
Thanks for any help. Answer any of them you want, or answer none at all! Thanks for any future help, though!
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
|