Displaying and image w/ the touch of a button
- Posted by RedDan11 at AOL.COM Mar 17, 2001
- 491 views
Well the change over from DOS to Windows has thrown me yet another curve. My movement engine dosn't seem to be working. I have simplified it and simplified it to see if I could find the problem and it has come down to this, displaying a single image by the press of a button (in this case "i") In DOS this seemed to work fine, but not in windows. The only problem I can think of is that get_key may not be a windows command. Heres my code, take a look: include win32lib.ew atom keystroke, walk_up1, man_position --create a window constant MainWin= create( Window, "Theif", 0, Default, Default,600,600, 0 ) -- load bitmap and put it into a pixmap walk_up1 = create(Pixmap,"image",0, 5, 5, 20, 20, 0 ) setPixmap(walk_up1,"image.bmp") man_position = 50 -- *********************************************************************** -- Display image by pressing i keystroke = get_key() if keystroke = 'i' then copyBlt(MainWin,35, man_position, walk_up1) end if keystroke = get_key() -- ********************************************************************** WinMain(MainWin,Normal) -Dan Da Man (Thanx for your help)