bitmap come down
Hello guys,
I started to learn DirectX. I understand now the function "display" and the function with that sound handling. But i want know, that a bitmap come down from the top to the ground pixel for pixel. How can i make that?
So far...
alien ;D
Like have it move a line, pause, then move again, or just have it slide? Either way you need to have something that pauses for a certain length of time, changes the Y coordinate of the bitmap, then redraw with the new Y value.
I want that it slides over the window. But when i make it with a "for" or "while" loop, it doesn't work. It didnt show me then the picture sliding.
you need to change the Y coordinate that you are drawing the bitmap at each time you call render. so this means clear the screen and redraw the bitmap. some code would be helpful like post your for or while loop.
try and do something similar to weep_display.y(i); not really sure how its done in xna if you are using that
no, im using directX...
when i make it with my for loop, it doenst come slow down. Its just a big distorted image on the screen.
when i make it with my for loop, it doenst come slow down. Its just a big distorted image on the screen.
Quote:Original post by alieniZeBecause you're not rendering it - just moving it. Your code does this:
no, im using directX...
when i make it with my for loop, it doenst come slow down. Its just a big distorted image on the screen.
You want:
That means you need to do a whole render loop (Clear, BeginScene, render, EndScene, Present) each time you move your bitmap.
thanks a lot, i understand my problem now, but i dont know how i can fix it ;/
U told me a way, but i cant make it to a code :/
mfg alien
U told me a way, but i cant make it to a code :/
mfg alien
Well, it depends on how the code from your book is structured. Typically you'll have some kind of render loop which will call some main draw and/or update method X times per second. In this method you'd typically increase a variable y coordinate and then use dsply.Blt(someX, yourY, yourSprite); to draw it to the screen at the new position.
Going from your last topic I don't know if this is the case with your code, so it'll probably only get confusing to try and explain the general approach further. Looking at the book index you posted last time, you might want to check out paragraph 3.2 (page 138-159), since that seems to deal with movements.
This way you know the info correctly applies to the code you're using, which should prove more useful than our random guesses as to how your code works [smile]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement