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]
31
General / Re: Weird problem
« on: January 22, 2014, 10:00:26 pm »
Some font present on Window does not work in SFML, try the classical arial.ttf to see if the problem is the same.

32
General / Re: Enable user to open file
« on: January 22, 2014, 09:58:35 pm »
Msquared I send you a eMail on member acount to continue the conversation in private, please go see it.

Thanks.

33
General / Re: Enable user to open file
« on: January 22, 2014, 05:46:48 am »
However, I don't know how to send a complete project on this forum. :'(

34
General / Re: Enable user to open file
« on: January 21, 2014, 11:08:34 pm »
I am actually working on a file selector window for Window (The OS, It's the one I use).

If you are using Window and you are interessed in my project, I could send you the source code (There is some bugs left, but it works pretty well) :D

35
Graphics / Re: sf::text size and 'highlighting'.
« on: January 18, 2014, 05:19:12 am »
Here is a drawing to brievly explain the "bounds".

The central vertical Line represent the  Text.getPosition.x position.

The | | are absolute value ( This mean -1 * (A negative number) )

36
General discussions / Re: Games
« on: January 17, 2014, 05:54:31 am »
My question is: Why not?
SFML can create almost anything and very easily.

37
Window / Re: TextEntered Event does weird stuff
« on: January 16, 2014, 02:25:04 am »
Did you forget
 #include <iostream>
or
using namespace std;
?

38
Graphics / Re: Error load Image
« on: January 15, 2014, 01:23:13 am »
TApp.h

TApp::TApp()
: m_Window(sf::VideoMode(640, 480), "SFML Game Engine")
{
   sf::Texture texture;            //Problem here!
   texture.loadFromFile("sprites/first.bmp");
   m_sprite.setTexture(texture);
}


A common mistake. Once the TAPP() end, your texture is destroyed. However, a sprite use a pointer to the texture to draw, which does not exist anymore. Result, the sprite can not draw your texture.

You should add in your header:

sf::Texture m_Texture;

And in TAPP() use m_Texture.loadFromFile("sprites/first.bmp");

39
General / Re: SFML 2.0 AABB Class Help
« on: January 10, 2014, 05:54:39 pm »
Code: [Select]
min.x = playerTexture.getSize().x;
max.y = playerTexture.getSize().y;

And
Code: [Select]

        min.x = blockTexture.getSize().x;
max.y = blockTexture.getSize().y;


This is correct, isn't it?
Not really... Where are you checking positions? And why is your min depended on the size?
You most likely would want to go with the sprite instead.



        min = playerSprite.getPosition();
        max.x = playerSprite.getGlobalBounds().width;
        max.y = playerSprite.getGlobalBounds().height;

And
        min = blockSprite.getPosition();
        max.x = blockSprite.getGlobalBounds().width;
        max.y = blockSprite.getGlobalBounds().height;

Alternatively you can also use the global bound for the min, just access .top and .left.

You forgot to add position to max, it would be:
        min = playerSprite.getPosition();
                        max = min;       //max = playerSprite.getPosition();
        max.x += playerSprite.getGlobalBounds().width;
        max.y += playerSprite.getGlobalBounds().height;

And
        min = blockSprite.getPosition();
                        max = min;
        max.x += blockSprite.getGlobalBounds().width;
        max.y += blockSprite.getGlobalBounds().height;

Pages: 1 2 [3]
anything