Results 1 to 3 of 3

Thread: how to move a selected object?

Hybrid View

  1. #1
    Member
    Join Date
    Sep 02
    Posts
    38

    how to move a selected object?

    Hi,

    In my software lots of objects are there. When user wants to move one of them he selects it and moves it by keystrokes.

    What should I do to remove previous image of an object from previous position? Redrawing all objects will be very costly.

    I have hered of XOR, but I dont know how to use it.

    Plz help me.

    If possible give some example.

    Any help will be appreciated.

    Thanx.

  2. #2
    Fanatic Member alkatran's Avatar
    Join Date
    Apr 02
    Location
    Canada
    Posts
    860
    Save a picture of the background before you put the object there, then restore it when it moves (make sure all objects leave in the OPPOSITE order they appeared, or you might get some bugs) make sure you use a mask for restoring background too... don't want to cover other objects...
    Don't pay attention to this signature, it's contradictory.

  3. #3
    Frenzied Member cyborg's Avatar
    Join Date
    May 00
    Location
    Sweden
    Posts
    1,755
    xor=for example:
    0101 xor
    0110 =
    0011

    you see, 1 xor 1 = 0, 0 xor 0 = 0, only 1 xor 0 and 0 xor 1 = 1

    i dont know what to use this for other than electric components...but i cant see how you assosiate this with painting a picture...

    look here: http://www.vbforums.com/showthread.p...hreadid=238634
    Check out the FAQ and do a search before you post.
    My tutorials: Anti-Alias Pixels, Accurate Game Loop, Resource File

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •