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 - Power

Pages: 1 ... 3 4 [5]
61
Graphics / Re: A total of 7 questions
« on: April 01, 2020, 11:53:29 am »
Quote
I don't want to make a post for every question, maybe i should?
Let's think about it. What's the difference with you opening 7 different posts, and 7 different users opening 1 post each? None, both are fine. Or, imagine that you had 1 problem per month during 7 months, you wouldn't have the silly idea to edit the same post to add them all to it everytime.

On the other hand, mixing unrelated questions in a single post makes it hard to:
- find relevant information when finding your post through the search engine
- read all that stuff (I personally gave up)
- reply to a single question
- follow 7 different discussions mixed together, after some time passes and replies are posted

Definitely the worst idea ever. I don't know why so many people think it's "bad" to open multiple posts ;)
I understand, and i actually think i have found an old post of yours recommanding users to write multiple posts instead of having one and reviving each time .
The reason i found it useful to put many questions in one topic, is because i saw that few points were related (the rotation part, and then the use of matrix on transformable (which is not found in the tutorial)).
If you could read only one thing is why is there a "sf::Uint8" SFML class, hence the "sf::", that cannot be found on this list? https://www.sfml-dev.org/documentation/2.5.1/annotated.php (it would have been useful for me or other "new comers".
Will try to make separate posts whenever the questions are not related.

1)
These can explain it much better than I can:
https://en.wikipedia.org/wiki/Matrix_(mathematics)
https://en.wikipedia.org/wiki/Matrix_(mathematics)#Linear_transformations
https://en.wikipedia.org/wiki/Rotation_matrix
Oh i see so that's what i was missing. Ok so let's say i have understood the effect of each rotation matrix/linear transformation, how could i use it then? Let's i have this one :
[-1 0]
[0 1]
Which is a Reflection through the vertical axis or wichever matrix containing cos and sin, should i read more to know how to use them? i can't find an example of a code using a matrix transformation (puting aside which matrix you are using, just how can it be used once you got your matrix).

Quote
2)
Yes, it's possible.
Rotation is always around the object's origin.
You can set O's origin to the offset between O and R and then set O's position to the same as R. O's origin will offset the visual position of O but all rotation will go around R.
Since they (O and R) seem to be 300 apart in your example, O's origin would be (0, 300).
Oh delightful, it seems to be working :
..
int rot=10;
..
if(event.key.code==sf::Keyboard::T)
                {
                      O.setOrigin(R.getPosition()-O.getPosition());
                      O.setPosition(R.getPosition());
                      O.rotate(rot%360);
                      rot=rot+10;
                }
..
..
 window.draw(R);
window.draw(V);
 window.draw(O);
...
 
Result :

Note : Only at the second rotation, that O makes it close to R
Note 2 : it seems to be rotating around the origin of R indeed, and not around the center of R, i am pretty sure that fixable.

Quote
3)
Not sure I understand the question.
You can have different coloured triangles in a single vertex array but not in a standard SFML shape (without using a texture).
Understood.
Quote
4)
sf::Uint8 is an unsigned 8-bit integer.
Your example is an array of those necessary for an image - basically an array of bytes. Each colour component is an 8-bit value - 0-255.
Although, I would suggest that there is an error; it should be multiplied by 4, not 1, for the four components - one byte each.
Oh i see so the the Uint8 Pixels variable is an array containing the values for each pixel of the image taking in count all four componenots, meaning if i had a coloured image with a size of (4,5) that would mean the Uint8 variable would be an array of 20x4 length.
So now,  i guess it's time to change every pixel with some kind of "for" and browse the pixels you want to change, one by one or a range by range..?
And then at the end do :
tex1.update(pixels);
 
?

Would be great to see an example of this.

Quote
5)
Have you tried this without the difference? Does it work? Is it the same?
Yes i just did:
MyEntity(float NewPointcount) : PC(NewPointcount)
           {
               sf::VertexArray Vex(sf::TriangleStrip, PC);
               const sf::Color colorArray[5]={sf::Color::Cyan, sf::Color::Blue, sf::Color::Green, sf::Color::Red, sf::Color::Yellow };

               
                        srand(time(nullptr)); // use current time as seed for random generator

                                for (int n=0; n != PC; ++n)
                            {

                                int random_variable2 = rand()%400+1;
                                  int random_variable3 = rand()%500+300;
                                  Vex[n].position = sf::Vector2f(random_variable2+random_variable3, random_variable2/2);

                                  Vex[n].color = colorArray[rand()%5];
                            }

           };

private:

    virtual void draw(sf::RenderTarget& target, sf::RenderStates states) const
    {
        // apply the entity's transform -- combine it with the one that was passed by the caller
        states.transform *= getTransform(); // getTransform() is defined by sf::Transformable

        // apply the texture
        states.texture = &m_texture;

        // you may also override states.shader or states.blendMode if you want

        // draw the vertex array
        target.draw(m_vertices, states);
    }

    sf::VertexArray m_vertices;
    sf::Texture m_texture;
    int PC;
};
and
MyEntity ME(6);
..
..
window..draw(ME);
 window.display();
 
Nothing.
Reminder here is the code that works well in the same main :
 int N;
        cout << endl << " choose N : (below 26000) " << endl;
        cin >> N;
        sf::VertexArray Vexy(sf::TriangleStrip,N);
        srand(time(nullptr)); // use current time as seed for random generator
        for(int i;i!=N;i++)
        {

                  int random_variable2 = rand()%400+1;
                  int random_variable3 = rand()%500+300;
                  Vexy[i].position = sf::Vector2f(random_variable2+random_variable3, random_variable2/2);
                  Vexy[i].color = colorArray[rand()%5];

        }

...
window.draw(Vexy);

Quote
6)
tu and tv are arbitrary values to reference the tile within the texture and are used to set the texture co-ordinates for that tile.
t is for texture. u and v are common co-ordinate variables for texture (XYZ for space, UVW for texture)

In the tilemap example, it uses a vertex array with the quad primitive. Every one of those quad primitive requires four vertices to define its corners. Those vertices don't have to rectangular.
Those vertices don't have to BE rectangular. You meant? i Guess.

Quote
7)
Firstly, your cyan lines are incorrect. They should point to the same place as the red lines.

The "position" is where they are drawn/shown. You can see that the left row are all x = 0 and that y steps up by the height of the tile (i.e. in 32 increments).
The "coordinates TEX" is where in the texture that tile is using. You can see all the tiles that have grass all have the same co-ordinates. Each different tile has a different value (its location in the texture/tileset image).



Hope some of that helps :)
Ah indeed you got me there, it's a great example, i enjoyed trying to understand it, being new, yeah that was my mistake.
Yes Your help is MUCH APPRECIATED. Thank you so much.


62
Graphics / A total of 7 questions
« on: April 01, 2020, 12:10:39 am »
Hello,
I don't want to make a post for every question, maybe i should?

Here are all the questions i encountered so far, if someone could enlighten.. :

1) i reread almost all graphics tutorials except the "view" one, and i did not find a single example of a use of the a Transformable class with a matrix, i saw this on the tutorial page (https://www.sfml-dev.org/tutorials/2.5/graphics-transform.php)
sf::Transform t3(2.f, 0.f, 20.f,
                 0.f, 1.f, 50.f,
                 0.f, 0.f, 1.f);
I do understand how a Transform can "absorb" many transformation (Translate, rotate,scale...etc), and then merge the transform in a state or directly on a draw function.
But i have no clue what this matrix means?
I have been advised on another topic to use this matrix to do a rotation :
[cos(A)     -sin(A)]
[sin(A)      cos(A)]
 
I thought i could understand it later, but after rereading and trying to understand some SFML examples such the "tilemap" i still dont know what matrix have to do with Transformable.

2) ROTATION:
After re reading almost all turorials (except the "View" one) and trying to remember all graphics functions SFML have, i can finally say i dont know well how getRotation works.
Here an example of a rectangular shape with 2 other shapes i want to make them rotate AROUND the rectangle, the three shapes are named R (Rectangle), C(A triangle made with vertices) and O(and Object with a traingular shape, its the smallest and has one color, compared to the C triangle which is multi coloured).



sf::RenderWindow window(sf::VideoMode(800, 600), "It Works!", sf::Style::Close, contextSettings);
    window.setFramerateLimit(30);

    ///SHAPE1
    sf::RectangleShape R; // rectangle
    R.setPosition(450,350);
    R.setSize(sf::Vector2f(100,100));
    R.setFillColor(sf::Color::Black);
    ///SHAPE2
    sf::VertexArray V(sf::Triangles,3); //Triangle closest to the rectangle
    V[0].position = sf::Vector2f(R.getPosition().x,R.getPosition().y-100); // which is (450,350)
    V[1].position = sf::Vector2f(R.getPosition().x+100,R.getPosition().y-100); // which is (550,350)
    V[2].position = sf::Vector2f(R.getPosition().x+100,R.getPosition().y-200); // which is (550,250)
    V[0].color = sf::Color::Red;
    V[1].color = sf::Color::Blue;
    V[2].color = sf::Color::Yellow;
    ///SHAPE3
    sf::CircleShape O(30,3); // farest shape : object

    O.setPosition(R.getPosition().x,R.getPosition().y-300);
    O.setFillColor(sf::Color(100,0,50));

//        newOctagon.setOutlineThickness(6.f);
//    newOctagon.setOutlineColor(sf::Color::Red);
    O.setOrigin(R.getOrigin());
    O.rotate(45);
    //R.rotate(45);




   // triangle[0].color = sf::Color::Red;

    while (window.isOpen())
    {

        sf::Event event;
        while (window.pollEvent(event))
        {
            if (event.type == sf::Event::Closed)
                window.close();
        }

        window.clear(sf::Color::White);

        window.draw(R);
        window.draw(V);
        window.draw(O);

        window.display();
 

So is it possible to make O which is a CircleShape, rotate around R?
Is it possible to make T which is a vertex type, rotate around R?

3)
Is it possible to fill multiple colours for regular shapes(not vertices) choosing areas with "Rect" ? (
Example like this :

4) On the class sf::Unit8
I am not sure How it it used, because i find no classe called "Unit8" browsing the documentation: here an example i saw somewhere :
sf::Uint8* pixels = new sf::Uint8[width * height * 1]; // * 4 because pixels have 4 components (RGBA)
//sf::Uint8* pixels = new sf::Uint8[width /2];
 // sf::Uint8* pixels2 = sf::Vector2f(400,0)...; // get a fresh chunk of pixels (the next frame of a movie, for example)
                    tex1.update(pixels); /// FIRST PROB
 

What happens to the Texture tex1 here?

5) A random vertices generator does nor work inside a new "MyEntity" class while drawing it on the window, but the code works outside the new class (inside main), this:
        int N;
        cout << endl << " choose N : (below 26000) " << endl;
        cin >> N;
        sf::VertexArray Vexy(sf::TriangleStrip,N);
        srand(time(nullptr)); // use current time as seed for random generator
        for(int i;i!=N;i++)
        {

                  int random_variable2 = rand()%400+1;
                  int random_variable3 = rand()%500+300;
                  Vexy[i].position = sf::Vector2f(random_variable2+random_variable3, random_variable2/2);
                  Vexy[i].color = colorArray[rand()%5];

        }
 
Result :


But while i m using a new classe, like this one, it does not work(does not show up with the function draw)
using namespace std;
class MyEntity : public sf::Drawable, public sf::Transformable
{
public:


    MyEntity(float NewPointcount) : PC(NewPointcount)
           {
               sf::VertexArray Vex(sf::TriangleStrip, PC);
               const sf::Color colorArray[5]={sf::Color::Cyan, sf::Color::Blue, sf::Color::Green, sf::Color::Red, sf::Color::Yellow };

                ///USING THE FUNCTION RAND => HASARD
                        srand(time(nullptr)); // use current time as seed for random generator
                        Vex[0].position = sf::Vector2f(0, 0);
                        Vex[0].color = colorArray[rand()%5];
                        for (int n=1; n != PC-1; ++n)
                            {
                                int random_variable = rand()%200+1;
                                int random_variable3 = rand()%600+300;
                                cout << "Random value on [0 " << RAND_MAX << "]: "
                                      << random_variable << '\n';

                                  Vex[n].position = sf::Vector2f(random_variable, random_variable3);
                                  cout << rand()%5 << endl;

                                  Vex[n].color = colorArray[rand()%5];
                            }
                            Vex[PC-1].position =  sf::Vector2f(0, 0);
                            Vex[PC-1].color = colorArray[rand()%5];


           };

private:

    virtual void draw(sf::RenderTarget& target, sf::RenderStates states) const
    {
        // apply the entity's transform -- combine it with the one that was passed by the caller
        states.transform *= getTransform(); // getTransform() is defined by sf::Transformable

        // apply the texture
        states.texture = &m_texture;

        // you may also override states.shader or states.blendMode if you want

        // draw the vertex array
        target.draw(m_vertices, states);
    }

    sf::VertexArray m_vertices;
    sf::Texture m_texture;
    int PC;
};
 
and inside the main :
MyEntity ME(6);
..
window.clear(sf::Color::Black);
window.draw(ME);
window.display();
 

Nothings shows up. Also the difference between using the CLASS and the exemple before is that i set the first and last vertices outside the "for".

6) My last question is about the "Tilemap" example :
Which can be found at the bottom of this page : https://www.sfml-dev.org/tutorials/2.5/graphics-vertex-array.php

I had a hard time  undesrtanding the the variables tu and tv, i think a sentence should be written as comment to describe them, it's a google search on them and made me fall on one of the old posts from SFML forum and made me understand that : "tu and tv are the tile coordinates of the texture. tu is the column of the tile, and tv its line."

Okay what does this line exactly do?
 m_vertices.resize(width * height * 4);
I can read here : https://www.sfml-dev.org/documentation/2.5.1/classsf_1_1VertexArray.php
that the resize function purpose is to change the number of "points" or "vertices".
Dont we always need 4-5 vertices to draw a tile? Which is rectangular?
I really dont get this line i keep finding everywhere : "(width * height * 4)"

7) Also, i did an experiment, with adding a "cout" to know the location of the FIRST point of each tile + the location of the first TexCoord for each said point :
                quad[0].position = sf::Vector2f(i * tileSize.x, j * tileSize.y);
                cout<< " position 1           :" << i * tileSize.x << "-" << j * tileSize.y << endl;
                quad[1].position = sf::Vector2f((i + 1) * tileSize.x, j * tileSize.y);
                quad[2].position = sf::Vector2f((i + 1) * tileSize.x, (j + 1) * tileSize.y);
                quad[3].position = sf::Vector2f(i * tileSize.x, (j + 1) * tileSize.y);

                // define its 4 texture coordinates
                quad[0].texCoords = sf::Vector2f(tu * tileSize.x, tv * tileSize.y);
                cout<< " coordinates TEX 1 :" << tu * tileSize.x<< "-" << tv * tileSize.y << endl;
                quad[1].texCoords = sf::Vector2f((tu + 1) * tileSize.x, tv * tileSize.y);
                quad[2].texCoords = sf::Vector2f((tu + 1) * tileSize.x, (tv + 1) * tileSize.y);
                quad[3].texCoords = sf::Vector2f(tu * tileSize.x, (tv + 1) * tileSize.y);
 

And i noticed this :

I still find it hard to understand it, i guess i will have to do many more examples to get it quicker, it seems that quad.position thing browses line by line after finishing a line one after another (from left to right), while quad.texCoors seems to browse vertically (from up to down then it changes the collumn)
Anyway this last question was not really a question.



63
Feature requests / Re: Full UML Class Diagram for SFML?
« on: March 31, 2020, 09:28:28 pm »
Looks great, i did not know this tool, i am saving the name.

eXpl0it3r: It's almost like what you described, i saw a few examples on youtube, and it seems to be the right tool.
 
Here is what i was imagining though (image attached)

64
Feature requests / Full UML Class Diagram for SFML?
« on: March 30, 2020, 10:53:35 pm »
Hello,
While i am browsing the SFML documentation, i can stumble on little diagrams showing which class inhetit who (like here : https://www.sfml-dev.org/documentation/2.5.1/classsf_1_1CircleShape.php).
I also found myself rewriting all this information on paper and trying to have a full view on all the available functions available.

I wondered if there was a full diagramm class showing all the inheritance between all classes? To have a place where you can click on any class at one glance.

65
Graphics / Re: Do these three features exist?
« on: March 25, 2020, 01:49:49 am »
An easy way to do this is with a matrix:
let's say you have a center of rotation, C, and an angle of rotation, A.
your shape is made of a bunch of little shapes - you can just apply this transformation to each one.
let's say your shape's vertices are {(x,y), (x1, y1), (x2,y2)}
create a new shape with vertices at {(x-C, y-C), (x1-C, y1-C), (x2-C, y2-C)}
apply the 2D rotation matrix (oh boy how do I format this):
[cos(A)     -sin(A)]
[sin(A)      cos(A)]
to each one of the new shape's vertices and then just add C back to each one.

Apply this to every one of your shapes and they will rotate exactly!

Hello, sorry i am trying to use this only today (i have been busy),
Whay do you mean by the 2D rotation matrix?
Yoo described three vertices and then showed a matrix containing 4 operations,
I see on the documentation : https://www.sfml-dev.org/documentation/2.5.1/classsf_1_1Transformable.php
only one 2 rotation functions : setRotation (float angle) and rotate (float angle), both have only one argument. Could you expand please?
If anyone has the answer, feel free.. since A_Sentient_Tomato is nota regular user he might not see this.

(Remember i know some math but mostly i am a free c++ learner.)

66
Graphics / Re: Do these three features exist?
« on: March 25, 2020, 01:44:46 am »
Some community members have written libraries for certain things.

Thor: https://bromeon.ch/libraries/thor/
SelbaWard: https://github.com/Hapaxia/SelbaWard/wiki
Plinth: https://github.com/Hapaxia/Plinth
RichText: https://github.com/skyrpex/RichText
ImGui-SFML: https://github.com/eliasdaler/imgui-sfml

If you google a bit, you can find lots of related code.
It's really great to all this to dive in. SFML is really great.

67
It's there:

     union
     {
         SizeEvent             size;              
         KeyEvent              key;              
         TextEvent             text;              
         MouseMoveEvent        mouseMove;        
         MouseButtonEvent      mouseButton;      
         MouseWheelEvent       mouseWheel;        
         MouseWheelScrollEvent mouseWheelScroll;  
         JoystickMoveEvent     joystickMove;      
         JoystickButtonEvent   joystickButton;    
         JoystickConnectEvent  joystickConnect;  
         TouchEvent            touch;            
         SensorEvent           sensor;            
     };

An instance of the MouseWheelScrollEvent structure, and member of the sf::Event type.

Above is an anonymous union, in case you want to read more about that kind of structure.

Thank you.

68
General / How to be more efficient and faster in coding?
« on: March 16, 2020, 11:37:14 am »
Hello,
Since the coronavirus outbreak, and even before, i tried to spend some time to try to make my first game, and  it made me realize that i had to relearn all of SFML through tutorials since i am pretty new to SFML and the only free courses i took on SFML were not enough to cover everything.

But i find myself very slooww, what i thought finishing in one night, i found myself doing it in many days.

I tried to ask myself the question, how to get things done and be efficient in coding and code learning? i tried to see my patterns and see what "distracted" me.

I am curious about your experiences and your solutions. How do you learn a new langage fast? How do you code and focus and get things done fast with no distractions? What's your best and more efficient methods.

Thanks,
P~

69
SFML wiki / Confusion while Reading the documentation on : Events
« on: March 09, 2020, 07:59:52 pm »
Hello,

(I am still new to c++, but i made quite lot of progress, i am not a computer science student although.)

I have a question that could appear "non intelligent" but it kinda confused me. Here it is:
While using the "window" module, its functions were easy to use and pretty straighforward (https://www.sfml-dev.org/documentation/2.5.1/classsf_1_1Window.php)
The "Public Member Functions" section contains all the functions at one glance, for instance i can use window1.isOpen() if i created and object called window1 from the classe Window.

But then i went to the event page (https://www.sfml-dev.org/documentation/2.5.1/classsf_1_1Event.php)
because i wanted to check an example that i had read from here : https://www.sfml-dev.org/tutorials/2.5/window-events.php which is below:
         
  if (event.type == sf::Event::MouseWheelScrolled)

 {
 if (event.mouseWheelScroll.wheel == sf::Mouse::VerticalWheel)
   cout << "wheel type: vertical" << endl;
else if (event.mouseWheelScroll.wheel == sf::Mouse::HorizontalWheel)
 cout << "wheel type: horizontal" << endl;
else
 cout << "wheel type: unknown" << endl;
 cout << "wheel movement: " << event.mouseWheelScroll.delta << endl; // this line
 cout << "mouse x: " << event.mouseWheelScroll.x << endl;
   cout << "mouse y: " << event.mouseWheelScroll.y << endl;
                }
I got confused when i read this part "  event.mouseWheelScroll.delta",

What is : "mouseWheelScroll"?
It can neither be found on the classes section of the Event pages nor the public types, i can see it on the public Attributes somehow.
Checking the Event.hpp page : https://www.sfml-dev.org/documentation/2.5.1/Event_8hpp_source.php, i don't find "mouseWheelScroll", only "MouseWheelScrollEvent" and "MouseWheelEvent" which are different from "mouseWheelScroll".
As for the "delta" in "event.mouseWheelScroll.delta" no confusion, it's one of variables of the structures i found on the "Event.hpp" page.

Sorry if the answer is obvious, maybe i miss something in c++ that i still need to learn. If yes, please do enlighten me.
Thank you

70
Graphics / Re: Do these three features exist?
« on: March 08, 2020, 09:52:59 pm »
An easy way to do this is with a matrix:
let's say you have a center of rotation, C, and an angle of rotation, A.
your shape is made of a bunch of little shapes - you can just apply this transformation to each one.
let's say your shape's vertices are {(x,y), (x1, y1), (x2,y2)}
create a new shape with vertices at {(x-C, y-C), (x1-C, y1-C), (x2-C, y2-C)}
apply the 2D rotation matrix (oh boy how do I format this):
[cos(A)     -sin(A)]
[sin(A)      cos(A)]
to each one of the new shape's vertices and then just add C back to each one.

Apply this to every one of your shapes and they will rotate exactly!
Amazing. I am going to try this then, i hope it works.

If u want to move multiple items together, just have all the related items stored somewhere, and when moving one of them, move everyone. The same for rotation. I think I know what u mean that the shape after rotation is not the right one. It has to do with rotation origin. If I'm not wrong, SFML allows u to set origins outside of sprite boundaries, which means u need to set child items origins to the main one. If SFML doesn't allow it, but I doubt, after every rotation u have to reposition the items (which probably is what Sentinent said)
Yes as i am just learning SFML, i did not know about these details.
Thank you
I might give an update when i do it.

71
Graphics / Re: Do these three features exist?
« on: March 08, 2020, 07:27:02 pm »
This is what i was going for before making this thread, i wanted to make the item shown in my profile picture, and make it :
1) Rotate
2) Make the item not like a full rectangle, it means its boundaries must be like the picture

So i thought about making multiple little rectangle/triangles and bind them to make the item, but then how can i rotate all the binded items at once without losing exact shape of the item, this is where i am stuck right now.

72
Graphics / Re: Do these three features exist?
« on: March 08, 2020, 07:09:59 pm »
I did not know about 2dBox. Thanks

I understand,

question for you though, is there a place/list somewhere where people share their more complexe functions/objects made with simpler SFML functions?

Not that i don't want to try making my own more complicated fonctions it's part of the fun of course.

73
Graphics / Re: Do these three features exist?
« on: March 08, 2020, 01:14:33 pm »
Hi,
1) Yes that's i thought, so every item i draw will be a rectangle, i wondered with there was a program that could transform any drawing, by looking at the pixels valors (0 or different from 0), into a script describing multiple items (triangles and rectangles) that form in the end one final complicated item similar to the one i draw in paint.

2) Fx8qkaoy, well i wanted to make it happen inside the program, let's say we have an item that collects other items, first item can be moved using keyboard, other items cant, until they are touched by first item, first item becomes bigger  and thus the played can now move first item+ new item attached to it.
That was the plan.

3) Yes i see, thank you.

I am just starting SFML after folowwing a tutorial, but i realise a lot of research and experimentation has to be done. It's great to have this anyways.
I am prety sure there is still a lot i don't know

74
Graphics / Do these three features exist? [Solved]
« on: March 08, 2020, 08:42:14 am »
Hello,
I was very exciting to discover SFML and the world of programming,
Now i have few quick questions if someone expert knows the answer

1) Is it possible to draw an object (with paint) and use some kind of tool/programm to transform it into a real in game item with the exact shape you have drawn?  (meaning the item will have the collision area you have drawn)

2) Is there a function to merge items/objects into 1 item? (example : 2 circles meet each other (one circle hits the other), resulting in making one single item with a shapre of "8")

3) Is it possible to give an item, let's say a rectangle, 4 different kind of interactions with other items depending on which side of the rectangle was hit by another item? (So if a user rotated the rectangle to make it hit with the side number 2 or 3, the result would change, my question is, can SFML differenciate between the 4 sides of the rectangle?)

Thank you
And a have a good day
P-

Pages: 1 ... 3 4 [5]
anything