1
General / Re: Rect.Contains() don't behave Correctly in some cases
« on: June 14, 2016, 02:42:28 pm »
oh well, iam Deeply Sorry about opening this thread as i have figured out whats the problem is, which i feel that i wasted your time with this simple problem.
the tutorial was written in about 2010 and at this time the author was using sfml 1.6 (i think) which defines a rect as (top,bot,left,right) so
so what to do, to mark this thread as solved/closed etc
and ofcourse thanks for everyone who tried to help, and iam sorry for not noticing it before and ofcourse for wasting your time.
the tutorial was written in about 2010 and at this time the author was using sfml 1.6 (i think) which defines a rect as (top,bot,left,right) so
playbtn.rect.top =145; playBtn.rect.height = 380;
was written as playbtn.rect.top =145; playBtn.rect.bottom = 380;
means that the top line is at 145 and the bottom is at 380. after you clarified that it is now "Height" not "bottom" (i previously just changed it to work without noticing the difference as i was just trying to follow up the tutorial). i figured out that i just need to recalculate the height -which is not instantly obvious btw- so it workedplayBtn.rect.top = 145;
playBtn.rect.height = 233; //380= 145 + 233
exitBtn.rect.top = 383;
exitBtn.rect.height = 185; //576 = 383 + 186
playBtn.rect.height = 233; //380= 145 + 233
exitBtn.rect.top = 383;
exitBtn.rect.height = 185; //576 = 383 + 186
so what to do, to mark this thread as solved/closed etc
and ofcourse thanks for everyone who tried to help, and iam sorry for not noticing it before and ofcourse for wasting your time.