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

Author Topic: Coordinates of the whole texture.  (Read 1779 times)

0 Members and 1 Guest are viewing this topic.

DarQ

  • Newbie
  • *
  • Posts: 7
    • View Profile
Coordinates of the whole texture.
« on: May 02, 2018, 03:44:29 pm »
Hey, i've been googling since yesterday but i can not find answer for my question. I'm newbie with sfml and i want to create a test game for myself and i have no idea how to get coordinates of my image. I mean i want to add texture with irregular shape (like skull or tower or something else) and when i add it i want to get x and y of every pixel from it, I want to make it working with mouse cursor when cursor reaches image, not making it as  Bounding boxes (effect works when cursor is on sqare background of image). Sorry if it's too chaotic, hope you understand my text  :P

CowNation

  • Newbie
  • *
  • Posts: 20
    • View Profile
Re: Coordinates of the whole texture.
« Reply #1 on: May 02, 2018, 04:56:03 pm »
To make something with an irregular shape, import image as a texture then make a sprite and set it's texture to the one you loaded in.
As for collision with the mouse, you should check out:
AND/OR https://github.com/SonarSystems/SFML-Box2D-Tutorials/tree/master/SFML/Tutorial%20013%20-%20Pixel%20Perfect%20Collision%20Detection.

DarQ

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Coordinates of the whole texture.
« Reply #2 on: May 02, 2018, 05:10:28 pm »
Thank you man, that's exacly what i needed :P

CowNation

  • Newbie
  • *
  • Posts: 20
    • View Profile
Re: Coordinates of the whole texture.
« Reply #3 on: May 02, 2018, 05:16:29 pm »
No prob dad