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 - 74oshua

Pages: [1]
1
Graphics / Re: Problem with adding texture (_imp___ZN2...)
« on: June 17, 2017, 06:34:50 am »
Oh, lol, duh XD sorry. Make sure that you include the release libraries in release mode, and the debug libraries (the ones that end in -d) in debug mode.

2
Graphics / Re: Problem with adding texture (_imp___ZN2...)
« on: June 16, 2017, 08:39:42 pm »
Hello! Sorry that you're having problems. Can I ask what program you're using (Code::Blocks, Visual Studio, etc.)

3
thank you! The ultimate problem was that I was putting things in the gameloop that I shouldn't have. (P.S.: setColor is deprecated, the new version is setFillColor)

4
Hello, I looked around on the forums and couldn't find any problems like mine.
I am trying to write a journal program, and I want to utilize sf::Text and sf::Font. My program is able to successfully load the font file without error, but when I use text::setString and display the text, I don't get anything. I have noticed that if I setStyle to underline, a line will appear. I have tried this with multiple .ttf files and none have worked. Any help is appreciated  :D

Here is my code:

#include <SFML/Window.hpp>
#include <SFML/Graphics.hpp>
#include <SFML/System.hpp>
#include <SFML/Network.hpp>
#include <SFML/Audio.hpp>

int main()
{
   int screenWidth = 500;
   int screenHeight = 500;
   sf::Font font;
   sf::Text text;
   sf::RenderWindow window(sf::VideoMode(screenWidth, screenHeight), "Window");
   while (1)
   {
      //refresh window
         window.display();
         window.clear(sf::Color(100,0,0,255));
      //set font
         font.loadFromFile("dotty.ttf");
      //draw text to screen
         text.setFont(font);
         text.setString("Hello world");
         text.setCharacterSize(24);
         text.setFillColor(sf::Color(0,0,0,255));
         text.setStyle(sf::Text::Bold | sf::Text::Underlined);
         window.draw(text);
   }
}

Pages: [1]