0 Members and 2 Guests are viewing this topic.
if ((0 < MouseX && MouseX < 162 && 124 < MouseY && MouseY < 260) && (Event.MouseButton.Button == sf::Mouse::Left) && (Jeopardy[1] == 1)) { Question = 1; JeopardyPos = 1; }; if ((Event.MouseButton.Button == sf::Mouse::Right) && (Question > 0)) { Jeopardy[JeopardyPos] = 0; Question = 0; }; };
it works now yay now how would i implement getting if the mouse cursor is over a certain picture and detect the click on/in the picture to change to a different picture without pasting code?Code: [Select] if ((0 < MouseX && MouseX < 162 && 124 < MouseY && MouseY < 260) && (Event.MouseButton.Button == sf::Mouse::Left) && (Jeopardy[1] == 1)) { Question = 1; JeopardyPos = 1; }; if ((Event.MouseButton.Button == sf::Mouse::Right) && (Question > 0)) { Jeopardy[JeopardyPos] = 0; Question = 0; }; };my implementation so far
cell size?? i dont get what you're talking about
BOOST_FOREACH(Sprite s, vSprites){ if ((MouseX > s.GetLeft() && MouseX < s.(GetLeft()+s.GetWidth())) && (MouseY < s.GetTop() && MouseY > (s.GetTop()-s.GetHeight())) { //Mouse position is over this sprite, do something about it here }}
for (int image = 0; image < 25; image ++){ if (image * category[image].GetWidth() < mousex < category[image].GetWidth()+204) && (image * category[image].GetHeight() < mousey < category[image].GetHeight()+153) { //Do Things Here }}
image * category[image].GetWidth() < mousex < category[image].GetWidth()+204
inline bool Overlap(sf::Sprite s,const sf::Input& input){ if((input.GetMouseX() >= s.GetLeft() && input.GetMouseY() >= s.GetTop()) && (input.GetMouseX() <= s.GetLeft()+s.GetWidth() && input.GetMouseY() <= s.GetTop()+s.GetHeight())) return true; else return false;}
if(Overlap(Sprite, App.GetInput()) == true) std::cout << "yeah" << std::endl;
lets say i have something on a flash drive, how do i make it so the program can access the media on the flash drive even though its letter changes? (ex. the flash drive is G:/flash drive on one computer and F:/flash drive on another and putting G:/flash drive in the code will cause an error on the computer that is F:/flash drive)
it doesnt work because im using images from my flash drive but the working directory is C:>>what do i do now?>>EDIT>>also, it seems that GetLeft(), GetTop(), etc. have been removed, how do i substitue functions to return the same effect?
sorry if i didnt make the post very clearim making the program on my hard drive, directory C:i have a flash drive attached where i copy the exe and it contains the images/music/etc. i need for the programwhen using LoadFromFile("../../Jeopardy.bmp"), i get an access violation error during runtimealso, how does one use GetPosition()? i keep getting something about the position being a Vector2f?