News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

help with movement

Started by JHER VON ARBANEL, August 13, 2005, 11:47:55 PM

Previous topic - Next topic

JHER VON ARBANEL

hi , me again ,color=Blue][/ i have a problem to make a imagen moke in the screen, i use to make de movement a image with a black background and top show the effect of movement i print it oiver it a black square and the image  one pixel up or down it depends where i want to move it,,, i hope that theres another way to make a o image move,,, plz help`me ,[color]

Mark Jones

Hello Jher. :)

Do you have the WIN32.HLP file yet? If so, look in there for "BitBlt" - that should be helpful. :)
"To deny our impulses... foolish; to revel in them, chaos." MCJ 2003.08

ToutEnMasm

Hello,
put the image that you want to move in another window or in a picture boxand and move the window with ... movewindow.Modifying the property of the window you can move circle and other forms.
There is a sample in the masm32 package
\masm32\examples\EXAMPLE4\ANIMATE\ANIMATE.ASM
                                     ToutEnMasm


JHER VON ARBANEL

#3
   :U  :bdgwell , i have studied all the examples, the one that you sugest me is is just to show the image arrow by arrowm, my question is: how can i move for example a complete image using cursor or mousedrag over another picture without lossing the back ground....... for example a plane   with cursor in the screen...  thanks or the your comments but they are not enoug
another example is : when program a game yoiu need your a ball moving around your applet ?? how can i improve that movements..
   :dazzled:  JHER VON ARBANEL

BogdanOntanu

You do look like very skilled into finding strange avatars and moving strings across our screen ...
All togehther with a lots of emoticons. Please take some decent time to improve your sentences and questions in such a way that we can understand your questions better...

I guess you ask something about color keying. Any decent GFX tutorial on Google should help.

IF you are using GDI you can use a mask. On DirectX you can make a custom (and faster routine for this)

For example in GDI:
===============
1)Copy the background rectangle under the destination into a buffer
2)AND with the mask to make a "clean" hole. The mask should have Zero where your sprite has pixels and ONE elsewhere.
3)BITBLT your sprite to this buffer using OR operations. Your sprite should have ZERO where background is.
4)Bitblt the resulting buffer bitmap on screen
-> and since the background part is the same it will not flicker or change.

5)You will have to restore the background of course when you move the sprite elsewhere.
->So you need to keep the background somewhere else into a clean state.
Ambition is a lame excuse for the ones not brave enough to be lazy.
http://www.oby.ro

UPucker

What about using a timer to automaticly move a sprite on the screen. For example to scroll up 20 lines/sec. I am using invoke SetTimer, hWnd, 1, 50, 0. And while this works, someone pointed out that this is a heavy load on the cpu. Should I be concerned? and is there a better way to do this?



BogdanOntanu


The DispatchMessage function forwards this message when no other messages are in the thread's message queue.


It is unreliable to be more exact... for some irelevant animation it will work ok...well mostly.
But for a game I would not use it.
I would either use a modifyed message loop (using PeekMessage) or a Thread.

How much load it brings on the CPU depends on what actions you do (how long it takes) on response to the WM_TIMMER event.

Ambition is a lame excuse for the ones not brave enough to be lazy.
http://www.oby.ro