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

Pages: [1]
1
Graphics / Re: Displaying text error SFML 1.6
« on: July 31, 2012, 02:38:05 am »
Alright so I reverted to stable and still nothing  :-\

2
Graphics / Re: Displaying text error SFML 1.6
« on: July 30, 2012, 09:09:24 pm »
I'm using the beta drivers from Nvidia for my Quadro NVS 4200M
Beta Driver 304.79 32 bit

3
Graphics / Re: Displaying text error SFML 1.6
« on: July 30, 2012, 07:06:24 pm »
Hmm so I've been getting opengl errors as well in my console now
"an internal opengl call failed in rendertarget.cpp <90> a numeric argument is out of range" :\

4
Graphics / Re: Displaying text error SFML 1.6
« on: July 30, 2012, 04:28:11 am »
The error even happened with the tutorial file from the 1.6 rendering text tutorial

5
Graphics / Re: Displaying text error SFML 1.6
« on: July 30, 2012, 02:44:44 am »
hmmm so the code below still gives me the same error :\ I put it in my main function
                        sf::String Text;
                        Text.SetText("ERMAGERD");
                        Text.SetFont(sf::Font::GetDefaultFont());
                        Text.SetColor(sf::Color(0, 128, 128));
                        Text.SetPosition(200.f, 300.f);
                        Text.SetSize(50.f);
                        App.Draw(Text);
 

6
Graphics / Re: Displaying text error SFML 1.6
« on: July 29, 2012, 02:46:17 pm »
Can you show how you use the Text class?

My guess is that the instance is copied somewhere (probably implicitely, when passed by copy to a function), and therefore the sf::String -> sf::Font link is broken. This is similar to what you can read at the end of the sf::Sprite tutorial.

sure
the object is declared in the level class header file as Text *hello;
It's intantiated in the loadtestLevel() function below.
I also wanted to know if the SetText function can take a std::string variable as a parameter? It doesn't give me an error when I do it but no text appears when I run the program  :-\

void Level::loadtestLevel()
{
        std::string a = "hi this is some text";
        hello = new Text(a, 200.f, 300.f);
}
 

7
Graphics / Re: Displaying text error SFML 1.6
« on: July 28, 2012, 11:55:31 pm »
Please give more details (code, version of SFML, ...)

http://en.sfml-dev.org/forums/index.php?topic=5559.msg36367#msg36367

I apologize for not having read the rules before!

I'm using visual studio 2010 on a windows 7 32 bit OS  with SFML v1.6


//TEXT CLASS HEADER

#pragma once
#include <SFML\Graphics\Font.hpp>
#include <SFML\Graphics\String.hpp>
#include <string>
#include <iostream>

class Text
{
public:
        Text(std::string b, float _x, float _y); //takes a string to output and position coordinates
        sf::Font myFont; //the font object
        std::string a;
        sf::String theText; //the string object
        float x; //the x coordinate for the text to be printed
        float y; //the y coordinate for the text to be printed
};
 

Text class cpp
#include "Text.h"

Text::Text(std::string b, float _x, float _y)
{
        if (!myFont.LoadFromFile("Fonts/BAUHS93.ttf"))
        {
                std::cout<<"Error loading the text HURRRRR DURRRRR \n";
        }
        else
        {
                std::cout<<"TEXT SUCCESSS ERMAGERD \n";
        }
        this->a = b;
        this->x = _x;
        this->y = _y;
        theText.SetFont(this->myFont);
        theText.SetText("ERMAGERD");
        theText.SetColor(sf::Color(0, 128, 128));
        theText.SetPosition(200.f, 300.f);
        theText.SetRotation(0.f);
        theText.SetSize(50.f);
}
 

The code blow is a segment from the main where the game is being drawn. Right now theGame is an object in the main and the update loop is a member of it. Test is the name of the level object. Each level in the game is it's own object containing that level's respective data. The level objects are members of the Game class and test is a "test level". Hello is an object of the Text class from above and theText is a string object that is a member from the class above.

theGame, test, and hello objects as they appear in the snippet below are all pointers to the objects (I think)
When you put the cursor over the respective objects they appear as
"Game *theGame"
"Level *test"
"Text *hello"
"sf::String Text::theText"


theGame->draw();
                        if(theGame->test->isLoaded==true)
                        {
                                sf::String paddy = theGame->test->hello->theText;
                                App.Draw(paddy);
                        }
                        App.Display();

 

8
Graphics / Displaying text error SFML 1.6
« on: July 28, 2012, 05:53:00 pm »

So I'm using the arial font and I have a statement in the console window that says success when the font is successfully loaded and error when it doesn't. I've tried 6 different fonts but all of them give me the same mangled result as the one in the picture. The text in the picture should say "ERMAGERD" and if you look closely, there's 8 character spaces but it appears as if the characters have been randomly cropped and flipped around  :-[
If anyone could help me out I'd really appreciate it  :D

Pages: [1]
anything