Posted By: JGGamer
mouse over button - What's Wrong - 01/26/10 18:12
Someone, please, I need help with this problem. I can't get it figured.
Is there something wrong with this code? When I move the mouse over the button, it does not change as it ought to. Help please.
Code:
BMAP* cursorImage = "cursor.pcx"; PANEL* panel_testButton = { layer = 100; scale_x = 0.7; scale_y = 0.7; button (0, 0, "test.tga", "test.tga", "test_light.tga", NULL, NULL, NULL); flags = OVERLAY | TRANSLUCENT; alpha = 100; } function main() { mouse_map = cursorImage; //set the mouse pointer bitmap mouse_mode = 2; // use mouse // set the rotation center at the panel center panel_testButton.center_x = panel_testButton.size_x * 0.5; panel_testButton.center_y = panel_testButton.size_y * 0.5; // set the size of the button panel_testButton.size_x = panel_testButton.center_x * 1.6; panel_testButton.size_y = panel_testButton.center_y * 1.6; // set position panel_testButton.pos_x = (screen_size.x)/2-50; panel_testButton.pos_y = (screen_size.y)/2+200; // start loop while(1) { // mouse cursor pos mouse_pos.x = mouse_cursor.x; // allow the mouse pointer to move mouse_pos.y = mouse_cursor.y; // on the x and y axis wait(1); //loop } }
Is there something wrong with this code? When I move the mouse over the button, it does not change as it ought to. Help please.