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

Pages: [1]
1
General discussions / Information about ObEngine
« on: April 13, 2018, 11:01:09 pm »
hi! i just found this repo on github : https://github.com/Sygmei/ObEngine
i really want to know why the travis build fail?... if i follow the " tutorial : Building Ă–bEngine "  it will work ? i would like to became a contributor, anyone know the owner? on the wiki there are some links broken... i would like to fix it .

2
General / Re: problem with SFML blueprints
« on: March 27, 2018, 05:30:21 pm »
really thanks man !

3
General / problem with SFML blueprints
« on: March 27, 2018, 04:45:59 pm »
I'm trying to implement the SFML blueprints book code and I'm finding many difficulties
can you tell me if the authors have said that there are errors?... many they have released some text file to fix some print-errors!

maybe can you tell me the best tutorial to start learning SFML? any youtube chanel or book??
thank anyway!

4
Window / Re: problem with SFML blueprints "no match for call"
« on: February 13, 2018, 08:10:27 pm »
I'm sorry to bother you ... i think i fix the problem but  the window dont want to stay open!

#include "Game.h"

void Game::run() {
        while (window.isOpen()){  //>>>>>>>>>> never get inside this
                processEvents();
                update();
                render();
        }
}
Game::Game() {
        sf::RenderWindow window(sf::VideoMode(800, 600), "Fast-Typing: The Game",sf::Style::Titlebar);
        sf::CircleShape player(150);
        player.setFillColor(sf::Color::Blue);
        player.setPosition(10, 20);
} ///// the window close after this

Game::~Game() {}
void Game::processEvents() {

        while (window.isOpen()) { // main Loop
                sf::Event event;
                while (window.pollEvent(event)) {
                        if (event.type == sf::Event::Closed) {
                                window.close();
                        }
                }
        }
}
void Game::update() {
}
void Game::render() {
        window.clear(sf::Color::Black);
        window.draw(player);
        window.display();
}
 


class Game {

public:
        Game();
        void run();
        virtual ~Game();

public:
        void processEvents();
        void update();
        void render();

        sf::RenderWindow window;
        sf::CircleShape player;
};

 



#include <iostream>
#include "Game.h"
using namespace std;

int main() {

        Game myGame;
        myGame.run();

        return 0;
}


 

5
Window / Re: problem with SFML blueprints "no match for call"
« on: February 13, 2018, 12:49:32 pm »
yeah man, it still not working ( see first pic)
i try to change that line with other definition and it give me the same errore

6
Window / problem with SFML blueprints "no match for call"
« on: February 13, 2018, 12:10:56 pm »
i just bought the "SFML blueprints" i was following the book when i found this "error" in the code and i dont know understand why ( see the picture ) some can help me?

7
Window / Re: wraped text in a renderwindow
« on: December 25, 2017, 02:13:27 pm »
You calculate the space the text takes up and insert a line break when it reaches a certain width.

yeah i've been thinking about it but i break to much lines! in my application will be 3 diferents text Areas! i dont know if the space ill be enough... can you make me a example how to define this area effectively without breaking to many lines? thx you

8
Window / wraped text in a renderwindow
« on: December 23, 2017, 07:11:28 pm »
i have a renderwindow ( see the pic in grey ) i need to define an AREA ( in the pic the rectangle with red edges )
in this AREA i want to load some text from a simple file.txt .
any suggestions? how to do it?
with this code i read the file , I really dont know how to define this AREA ?
void textLoader(Text *TmplineMenu) {

        string menuLine, tmpStr;
        ifstream infile;

        infile.open("Tools/datiMenu.txt");
        while (getline(infile, menuLine)) {

                size_t position = menuLine.find("||") + 1;
                menuLine.insert(position, "\n");
                tmpStr += menuLine;
                tmpStr += '\n';
        }
        TmplineMenu->setString(tmpStr);
        infile.close();
}

 
any suggestions ?

9
Graphics / Re: cant view string after read from file
« on: December 08, 2017, 07:23:49 pm »
setString replaces the string, it doesn't concatenate. So only the last line will be visible. And since you don't iterate correctly to read from your file, this last line is most likely empty.

how can i iterate the file correctly ?

10
Graphics / cant view string after read from file
« on: December 08, 2017, 06:57:55 pm »
i have a file.txt with some  text i want to read them and view in a render window with this function
 
    void textLoader (){
        bool dummy;
        string menuLine;
        ifstream infile;
        infile.open ("Tools/datiMenu.txt");
            while(!dummy){
                getline(infile,menuLine); // Saves the line in menuLine.
                cout<<menuLine <<endl;
                menu.setString(menuLine);
                dummy=infile.eof();
            }
        infile.close();
    }
 
the main part if I remove the comment from
// textLoader();
the line
 menu.setString("hello!!!");
is not visible any more!
int main(){

    RenderWindow window(VideoMode(1000, 600), "Scheduler Simulator",Style::Titlebar);

    fontLoad();
    menu.setString("hello!!!");
   // textLoader();
    menu.setCharacterSize(20);
    menu.setFillColor(Color::Red);

    while (window.isOpen()){ // main Loop
        Event event;

        while (window.pollEvent(event)){

            if (event.type == Event::Closed)
                window.close();
        }
       window.clear(Color::Blue);
       window.draw(menu);
       window.display();
    }

    return 0;
}

 

anyone can help me?

11
Graphics / Re: text from string is not visible any more
« on: December 07, 2017, 10:15:53 am »
What is the definition of fontLoader? Are you passing fontMenu by value instead of by reference?

oh my god you right i must use pointers! thx for help! all works now!

12
Graphics / text from string is not visible any more
« on: December 06, 2017, 09:55:41 pm »
i modified my code from this :
int main(){

    RenderWindow window(VideoMode(800, 600), "Scheduler Simulator",Style::Titlebar);
    Font font;
    Text menu;

    if(!font.loadFromFile("Tools/PIXEARG_.TTF")){
        std::cout<<"[MainWindow:Error] font not found" << std::endl;
    }

    menu.setFont(font);
    menu.setString("hello!!");
    menu.setCharacterSize(15);
    menu.setFillColor(Color::Red);


    while (window.isOpen()){ // main Loop
        Event event;

        while (window.pollEvent(event)){

            if (event.type == Event::Closed)
                window.close();
        }
       window.clear(Color::Black);
       window.draw(menu);
       window.display();
    }

    return 0;
}
to this
   RenderWindow window(VideoMode(1000, 600), "Scheduler Simulator",Style::Titlebar);
    Font fontMenu;
    Text menu;

    fontLoader(fontMenu);

    menu.setFont(fontMenu);
    menu.setString("hello!!");
    menu.setCharacterSize(20);
    menu.setFillColor(Color::Red);


    while (window.isOpen()){ // main Loop
        Event event;

        while (window.pollEvent(event)){

            if (event.type == Event::Closed)
                window.close();
        }
       window.clear(Color::Blue);
       window.draw(menu);
       window.display();
    }

    return 0;
and the string " menu.setString("hello!!"); " is not visible any more
 and i know why! some1 can help me??

Pages: [1]