i am not very good at handling event too but if i can answer what you are trying to create it is a button so if your function it is insert in a pollevent chain will work but i see something strange thing in it if( ( x > box.x ) && ( x < box.x + box.w ) && ( y > box.y ) && ( y < box.y + box.h ) )
box.x box.y box.w box.h are the coordinates of your rectangle but where you define in the function?
should be somewhere
alternatevly (never tryied you might try to import from somewhereelse very bad in my opinion)
void Button::handle_events(int box.x, int box.y, int box.w, int box.h)
albertinoMember Since 16 Apr 2012
Offline Last Active Oct 06 2014 11:24 PM