Don't draw them if the view zoom factor reaches a certain point. How? Well I don't know your code.
OK, I will try it by myself first. If I can't do it. May I ask you again?
and Others problem (many problem
)
Please guide me
Problem 1#ifdef SFML_STATIC
#pragma comment(lib, "glew.lib")
#pragma comment(lib, "freetype.lib")
#pragma comment(lib, "jpeg.lib")
#pragma comment(lib, "opengl32.lib")
#pragma comment(lib, "winmm.lib")
#pragma comment(lib, "gdi32.lib")
#endif // SFML_STATIC
#include <SFML/Graphics.hpp>
int posx, posy;
sf::View view1;
int main()
{
sf::RenderWindow window(sf::VideoMode(200, 200), "SFML works!");
sf::View view1(sf::FloatRect(0.f, 0.f, window.getSize().x, window.getSize().y));
sf::CircleShape shape(100.f);
shape.setFillColor(sf::Color::Green);
while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event))
{
if (event.type == sf::Event::Closed)
window.close();
if (event.type == sf::Event::MouseMoved)
{
posx = event.mouseMove.x - window.getSize().x / 4;
posy = event.mouseMove.y - window.getSize().y / 4;
}
if (event.type == sf::Event::MouseWheelMoved)
{
if (event.mouseWheel.delta >= 1)
{
view1.zoom(0.9f);
view1.setCenter(posx, posy);
window.setView(view1);
}
if (event.mouseWheel.delta <= -1)
{
view1.zoom(2.f);
view1.setCenter(posx, posy);
window.setView(view1);
}
}
if (event.type == sf::Event::Resized)
{
sf::View view1(sf::FloatRect(0, 0, event.size.width, event.size.height));
sf::FloatRect visibleArea(0, 0, event.size.width, event.size.height);
window.setView(sf::View(visibleArea));
window.setView(view1);
}
}
window.clear();
window.draw(shape);
window.display();
}
return 0;
}
From this code
When I resize window and zoom , my circle will be stretch.
--------------------------------------------------------------------------------------
Problem 2In the picture(Right side)
when I zoom in or out,
I want (0,0) coordinate to be in the red text not in the blue text
I've try Coordinates conversions in tutorial but doesn't work.
-------------------------------------------------------------------------------------
Sorry for bad English
Thank you very much