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

Author Topic: Colorful square with recent version of SFML  (Read 94 times)

0 Members and 1 Guest are viewing this topic.

Jukeyy

  • Newbie
  • *
  • Posts: 2
    • View Profile
    • Email
Colorful square with recent version of SFML
« on: August 13, 2019, 05:54:58 am »
I found this old piece of code on a french website:

    // Fenêtre de rendu

    RenderWindow app(VideoMode(600, 600, 32), "Mon superbe polygone SFML !");


    Shape carre;

    carre.AddPoint(200, 200, Color(255, 255, 0), Color(255,255,255));

    carre.AddPoint(400, 200, Color(255, 255, 0), Color(255,0,0));

    carre.AddPoint(400, 400, Color(0, 255, 255), Color(0,255,0));

    carre.AddPoint(200, 400, Color(0, 255, 255), Color(0,0,255));

    carre.EnableFill(true); // Remplissage activé

    carre.EnableOutline(true); // Bordures activées

    carre.SetOutlineWidth(20); // Bordures de taille 20 pixels

This picture is the result one should acheive -> https://user.oc-static.com/files/254001_255000/254040.jpg

All the member functions in the code seems to be outdated.. What class or function should I use to get an equivalent result as shown in the picture link?
I've tried ConvexShape.. worked fine to build a simple shape but couldn't get that cool colorful shape.

Thank you

Jukeyy

  • Newbie
  • *
  • Posts: 2
    • View Profile
    • Email
Re: Colorful square with recent version of SFML
« Reply #1 on: August 13, 2019, 07:59:26 am »
Okay nevermind! The solution is on this page -> https://www.sfml-dev.org/tutorials/2.5/graphics-vertex-array.php

:)