Computer Chess Club Archives


Search

Terms

Messages

Subject: Chess pieces snap to new squares, how?

Author: Eran

Date: 09:46:40 11/30/01



I develop a chess interface based on MFC 6. The draggable chess pieces, from
bitmap sources, are not based on Ole Drag and Drop at all but based on
OnLButtonDown, OnMouseMove, and OnLButtonUp functions. I successfully drag them
smoothly every where on the chess board window, but I do not know how to write
code that make a dragged chess piece snapped into a new square. In addition, I
do not know how to write another code that when a chess player cancels dragging
a chess piece, it should automatically snap back to an old square. I do not know
whether the CRectTracker::AdjustRect function works out for it.

If you know how to do it or if you have a nice code as a sample, please let me
know.

I would appreciate your help a lot.

Thanks in advance,
Eran
Owner of MS Visual C++ 6 program
My new email address: erk@012.net.il




This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.