|
: case WM_TIMER:
: if (ballmovey + ballr>rtClient.bottom - sticky && (stickex<ballx&&ballx<stickex + stickx))
: {
: moveon = 1;
: }
: if (ballmovey - ballr<rtClient.top)
: {
: moveon = 0;
: }
: if (moveon == 1)
: {
: ballmovey = ballmovey - ballmove;
: }
: else if (moveon == 0)
: {
: ballmovey = ballmovey + ballmove;
: }
: InvalidateRect(hWnd, NULL, TRUE);
: break;
:
case WM_PAINT:
: hdc = BeginPaint(hWnd, &ps);
: // TODO: 여기에 그리기 코드를 추가합니다.
:
: Rectangle(hdc, stickex, rtClient.bottom - sticky, stickex + stickx, rtClient.bottom); //스틱만들기
: if(ballmovey > rtClient.bottom)
: {
: ballmovey = bally;
: }
: Ellipse(hdc, ballx - ballr, ballmovey - ballr, ballx + ballr, ballmovey + ballr); // 공만들기
:
: //Rectangle(hdc, rt.left, rt.top, rt.right, rt.bottom); //사등분 사각형가장자리 틀
:
: MoveToEx(hdc, ptcent.x, rt.top, NULL);
: LineTo(hdc, ptcent.x, rt.bottom);
:
: MoveToEx(hdc, rt.left, ptcent.y, NULL);
: LineTo(hdc, rt.right, ptcent.y);
:
: EndPaint(hWnd, &ps);
: break;
:
: case WM_LBUTTONDOWN:
: hdc = GetDC(hWnd);
: if (mx<ptcent.x&&my<ptcent.y&&mx>rt.left&&my>rt.top)
: {
: Ellipse(hdc, rt.left, rt.top, ptcent.x, ptcent.y);
: }
: else if (mx<ptcent.x&&my>ptcent.y&&my<rt.bottom&&mx>rt.left)
: {
: Ellipse(hdc, rt.left, ptcent.y, ptcent.x, rt.bottom);
: }
: else if (mx>ptcent.x&&my<ptcent.y&&mx<rt.right&&my>rt.top)
: {
: Ellipse(hdc, ptcent.x, rt.top, rt.right, ptcent.y);
: }
: else if (mx>ptcent.x&&my>ptcent.y&&my<rt.bottom&&mx<rt.right)
: {
: Ellipse(hdc, ptcent.x, ptcent.y, rt.right, rt.bottom);
: }
: break;
:
//
WM_LBUTTONDOWN 부분을
WM_TIMER 부분처럼 작성하고 : InvalidateRect(hWnd, NULL, TRUE); break;
Ellipse(hdc, rt.left, rt.top, ptcent.x, ptcent.y); 를
WM_PAINT 으로 넣어주세요 -> if( 1,2,3,4 클릭상태) Ellipse(hdc, rt.left, rt.top, ptcent.x, ptcent.y);
|