Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Birdron

Pages: [1] 2
1
General / Re: Undefined Reference Error
« on: October 03, 2023, 10:18:20 pm »
Yes, I have linked sfml and defined SFML_STATIC. It was actually gcc version problem, I think. When I used prebuilt library of 2.6, it compiled without any error but when I run the app I get:- "libgcc_s_seh-1.dll not found" error. When I compiled sfml with tdm-gcc 10 I got this undefined reference error. So I removed tdm-gcc and downloaded codeblock with compiler and downloaded sfml 2.5. Now it is working without error.

2
General / Undefined Reference Error
« on: October 03, 2023, 08:47:44 am »
I just compiled SFML using cmake. And it only build static lib I think. I have attached the image of the build. Now when I try to compile hello world it says -
(click to show/hide)
Prebuild SFML is also showing same error. Version 2.6.

3
General / Re: Entity Selection box using zoom
« on: January 11, 2020, 09:22:41 am »
I am doing like this
setView(mainView)
sprite.draw(*this);
selection.draw(*this);

setView(overlayView);
sf::Vector2f position = selection.getPosition();
sf::Vector2f scale = selection.getScale();
mapPixelToCoords( mapCoordsToPixel( position, mainView), overlayView);
mapPixelToCoords( mapCoordsToPixel( scale, mainView), overlayView);
 
It is not mapping the pixel. I am getting the same result like image 2.

Thanks for reply.

4
General / Re: Entity Selection box using zoom
« on: January 10, 2020, 11:01:27 am »
Yes, it works if I draw it in same view, but than the rectangle also get zoomed in.
I have attached an image.
Image 1 is 100%, but when I zoom it, its pixel size increases like image 2. I want to keep the pixel size of the rectangle same pixel like image 3, bottom.

Thanks for reply.

5
General / Entity Selection box using zoom
« on: January 09, 2020, 08:27:26 pm »
Hi,
   Need a little help to draw a rectangle shape after zooming an entity(image).
   I am using view class to zoom an image. I have two view -
   1/ that draws the images, main view
   2/ to draw the rectangle, overlay view
Everything is working fine. But the problem comes when I zoom an image using main.zoom(200%), normal is 100%. The image size increases, My question is, how do I make the overlay rectangle zoom with main view, without changing its pixel size. I have attached an image. This is a selection rectangle that every application uses to show the user that an image is selected.

The right side(100%) and left side(200%) image is what I am getting. What I actually want to make is the third(bottom) image.

I am using SFML and wxWidgets.

Thanks in advance.

6
General / Saving Image Within A Rectangle
« on: December 06, 2019, 11:47:17 pm »
Hi,
   There is a method RenderWindow::capture which save all window as an image. Is it possible to save just those images which are inside a rectangleShape?
   I have attached an image, I just want to save the inner area. Which is a rectangleShape.

Thank you

7
General / Re: Double view and mouse position
« on: August 11, 2015, 04:40:55 pm »
Sorry, I almost forgot about my older posts :P. It was one year ago and I don't have that pc anymore, so couldn't remember that.

Thank you for the reply

8
General / Re: Double view and mouse position
« on: August 11, 2015, 04:26:21 pm »
This is how I am using my mouse pick,
Code: [Select]
mMousePos = sf::Mouse::getPosition(*this);
mWorldPos = mapPixelToCoords(static_cast<sf::Vector2i>(mMousePos));
And the picking function,
Code: [Select]
bool Entity::isPointInside(const sf::Vector2f& point)
{
    if(mSprite.getGlobalBounds().contains(point))
        return true;

    return false;
}

Thank you.

9
General / Double view and mouse position[SOLVED]
« on: August 11, 2015, 04:00:34 pm »
Hi,
   
   window.clear();

   //Render the sprites
   window.setView(MainView);
   window.draw(Hero);

   //Render others
   window.setView(GuiView);
   if(_dragging)
      window.draw(Box);

   window.display();
   
   The problem is, if I zoom the MainView, the mouse picking no longer works. But if I remove the GuiView, mouse picking works. How do I update the bounds of the Hero sprite after zooming out the MainView, so that I can pick it with mouse?

Thanks in advance.

10
General / Re: Zoom and Gui
« on: June 25, 2014, 09:35:35 am »
Ok, thank you.

11
General / Re: Zoom and Gui
« on: June 25, 2014, 09:15:01 am »
That mean I have to call view.setView continuously in loop. Is it ok?

12
General / Zoom and Gui
« on: June 25, 2014, 08:46:03 am »
Hi,
   When view is zoom in/out everything zoom in/out with it. Now I have some gui onscreen, which I don't want to zoom with map. How do I do it?

Thank you.

13
Graphics / Re: View zoom and mouse coordinate?
« on: June 15, 2014, 05:56:51 pm »
damn me, there was a zoom variable I used to zoom the viewport, which I was using to subdivide the rect of the view. I have so many files that I totally forgot about that variable. Just found it, and everything is working correctly :).

Thank you for your reply.

14
Graphics / Re: View zoom and mouse coordinate?
« on: June 15, 2014, 05:24:07 pm »
I mean calling the isPointInside() function.
I just print out all the values and found that everything is working fine except this -
Code: [Select]
MousePos = window.mapPixelToCoords(PixelPos, view);It always returns the Dimension of my window( also view), which is 1024x768. Even PixelPos is returning the correct mouse position, relative to my window.

EDIT: and when I set the zoom of view to 2 it returns - 1536x1050.

15
Graphics / Re: View zoom and mouse coordinate?
« on: June 15, 2014, 10:07:39 am »
Here is what I tried -
Getting the mouse position -
Code: [Select]
sf::Vector2i PixelPos = sf::Mouse::getPosition(window);
MousePos = window.mapPixelToCoords(PixelPos, view);

Here is the checking -
Code: [Select]
bool Entity::isPointInside(sf::Vector2i input)
{
    if(boundRect.contains(input))
    {
        return true;
    }

    return false;
}

Then I just check the MousePos, it is inside or not.


Pages: [1] 2
anything