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

Pages: 1 [2] 3
16
Graphics / Re: Objects using wrong textures
« on: April 07, 2014, 01:21:42 am »
It would help if you send a minimal code causing the problem, otherwise we can't help.

17
Graphics / Re: C++ white boxes displaying
« on: April 03, 2014, 12:31:27 am »
Why don't you simply use sf::VertexArray? Using sprite vector is not bad, but it requires to call a lot of draw in a short time. Also as explained in the tutorial, eventually you will reach your graphic card limit by using a lot of sprite.

18
Graphics / Re: texture rectangle problem
« on: April 02, 2014, 12:44:25 am »
It does what you asked to do.

 s.setTextureRect(sf::IntRect(-pos.x,0,20,20));
 

You take a rectangle of 20 by 20 rather than (20 + pos.x) x 20, pos.x < 0 here. The correct code would be:

 s.setTextureRect(sf::IntRect(-pos.x,0,20+pos.x,20));
 

19
Window / Re: SFML Events in Qt creator
« on: March 25, 2014, 12:23:36 am »
In your first post, you write:
cout << "work" << endl;

In your last post, your code contains:
cout << "work";

Last one will not print "work" unless you call std::endl sometime.


First of all cout does not work with Qt, you must use the qDebug class (See official website for more detail)
http://qt-project.org/doc/qt5.1/qtcore/qdebug.html


Also, endl is only a keyword to say end line and does not affect console printing. It only write the following text on a new line.


I've call endl, but nothing changed.

The Point is I want to mean that Qt can't detect event mouse wheel move.

Secondly, Qt can detect mouse wheel event, using qScrollEvent. However, I can not say in general if the SFML event are supported in Qt.

20
Graphics / Re: Font loading problem (Crash)
« on: March 19, 2014, 11:36:42 pm »
A quick note about your code (I know you are learning c++, but the best way to learn is to correct small errors ),

You must not put ; after an if statement, very bad!

Game::Game() : mWindow(sf::VideoMode(640, 480), "SFML Application"), mFont(), mText()
{
    if (!mFont.loadFromFile("consola.ttf"))
    {
       /* Handle loading error */
    };    //NO ; here -----------------------------------------------

    mText.setString("FPS: 0");
    mText.setFont(mFont);
    mText.setCharacterSize(12);
    mText.setColor(sf::Color::Black);
    mText.setStyle(sf::Text::Bold);
}

 

21
General / Re: Problem With Text
« on: March 18, 2014, 02:46:28 am »
There exist a C function to convert an iteger into a char*, but most of the c++ compiler do not support it.

Try this following code to see if it is defined:

#include <stdio.h>
#include <stdlib.h>

using namespace std;

string Text;
itoa( 10, Text, 10 );

 

If your compilator says that it does not recognize itoa then you will have to write your own function.

Edit:
Or use those proposed by didii :P

22
Graphics / Re: Crash if I set vertex color
« on: March 16, 2014, 03:30:06 am »
Dunno. But by curiosity, what kind of graph are you trying to draw? Function? Special curve? or anything else?

23
Graphics / Re: Crash if I set vertex color
« on: March 16, 2014, 12:55:41 am »
Effectively this is weird. With the given code, I do not see any error, maybe it's somewhere else in your code.

Another possibility is: Did you recently change your SFML version and forgot to update the library file or header?
It's an error I made when changing from SFML 2.0 to 2.1 and when running a program, it was always crashing.

24
Graphics / Re: Weird problem
« on: March 11, 2014, 04:59:22 am »
Tout d'abord, j'ignore si tu le sais, mais il existe une partie francaise du forum  ;).

I rapidly check your code, but I did not find anything suspicious. Except maybe the lone setTexture() in your Mot constructor (This is not the problem). Maybe it's only the way you use your class Mot inside the main.

25
General discussions / Re: Searching for music compositor software
« on: February 09, 2014, 04:54:02 am »
Sorry for not answering before, but I am very very busy with homework right now.

Most likely by "midi board" he means something like this.


Yeah this is what I mean, even if midiSwing can work with almost all of the Midi device.

"works better" means it is a lot easier to actually play a song on a keyboard vs manually arranging/composing music with a GUI.

Exactly. MidiSwing is made to record music played on a midi keyboard (I thought it was named board, sorry for the confusion  ;) ). Also, we can manually place note with the mouse.

LMMS is a great free music making program. I personally have Ableton Live, but I used to use LMMS, and it is great for being free.

Once I have the time, I will try it out.

26
The error I can see is that a sf::Text need to keep a pointer on a attributes of sf::Font, try using reference on sf::Font rather than using copy constructor.

I mean, use a reference for your TextWrap constructor.
 TextWrap(sf::Font& font);

Also, be sure to check if your font is correctly loaded, sometimes it can solve problems. :D



27
General discussions / Searching for music compositor software
« on: January 31, 2014, 04:08:32 am »
Hi, I am actually using a midi compositor program, named midiSwing, which is a very basic program to write music to the format .mid (I convert it afterward in .wav). However, this software works better with a midi board, which I do not have and I do not really want to pay for one.

So, I am wondering is there other music compositor software that can simplify my life to create music? Of course, I am searching for a totally free software and without the famous 30 days trial.

Thanks for your answer.

28
System / Re: I need urgent help with a project's music player
« on: January 27, 2014, 03:51:58 am »
You are changing the trackNumber outside the window.isOpen() loop. So, the trackNumber will only be increased once, try using a function that increase the trackNumber and call it inside the loop, after a certain key is pressed by example.

29
General / Re: diagonal movement = little shaking
« on: January 23, 2014, 05:00:09 am »
I don't think, a more complete code would be welcome. Specialy the part you are drawing your sprite.

30
Python / Re: Sprite without texture
« on: January 23, 2014, 03:52:28 am »
Yes, if you do not set a Texture on a sprite, it's normal that a white square is displayed.
Also, you can set the Texture before even if the texture is not created (Of course you must eventually create it before drawing the Sprite.)

Pages: 1 [2] 3