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

Pages: [1]
1
Window / It is Difficult to make collision with char and terrain
« on: February 27, 2012, 10:55:35 pm »
Hello.

I wanna makes or I have already simple terrain like this one
(its from google)


Do you know how a collision would be possible with this??

2
Window / if Windows isActive
« on: February 27, 2012, 10:52:40 pm »
hi, is there any bool function like windowIsActive?
I needn't to move when I am not in window like when I go to browser or chat a while.

Or do you u have any other Idea?

edit: sfml 2

3
Window / Window Not Opening
« on: February 25, 2012, 10:10:40 pm »
I have this problem, too. Long time before I did then my own build with cmake and vs2010. But still I have no window. Didn't understand. But I wanted again start to programming with a engine.. I haven't any other comparable engines for games (just something big for 3d games like unity3d, cryengine 3)

Is there any tutorial how I should and configure cmake for sfml 2?? Maybe I just did something wrong..

edit: It's ok.. had to just change one thing. Something liek SetText to SetTextA

4
Window / Create Window
« on: January 23, 2011, 04:50:14 pm »
I have this problem too... I have to rlly downgrade? That's look not good :S

5
Graphics / can't get it work SubRect
« on: January 30, 2010, 06:41:55 pm »
Hi, guys.
I want a mouseover + click script. I did and its working well. But if my sprites moves like 5 float right then subrect has same value. So i have read here i have to calculate it new.

I did that like:
Code: [Select]

if (RightKeyDown)
{
Player1.Move(5,0);
Player1.SetSubRect( sf::IntRect(Player1.GetPosition().x, Player1.GetPosition().y, Player1.GetPosition().x+50, Player1.GetPosition().y+50));
}


Are there wrongs?
Because click is working perfectly, but it lost their white color texture.

Screenshots to know what i mean:


When i have clicked

After moving 5 floats right. You see red what i did. There should be white. And in the area of red (between white and red) my click and mouseover works.

EDIT: Btw no rlly white i know. Its more grey :D

6
General / Any Key and Settext
« on: December 16, 2009, 07:57:49 pm »
But it works.
For test i've choosen A and B. 97 <= 98.
When i pressed the both key it changes to 1. Other key not. Its okay. How i want.

And now i want to show that 97 is A or 98 is B. I thought there is maybe something like "GetChar(98) then shows B.
So i could use SetText( GetChar(i)+: 1); // Result: A: 1

EDIT:
How is it in game if you want change hotkeys?

Omg how easy and stupid^^

Finally got it work
Code: [Select]

for(int i=sf::Key::A; i <= sf::Key::Z; i++)
{

if ((Event.Type == sf::Event::KeyPressed) && (Event.Key.Code == i))
{
int tmp = i;
tmp = tmp - 32;
char Buffer[10];
sprintf(Buffer,"%c: 1", tmp);
//MessageBox(NULL,Buffer,"Error",MB_OK | MB_ICONEXCLAMATION | MB_TOPMOST);
Text.SetText(Buffer);
}
else if ((Event.Type == sf::Event::KeyReleased) && (Event.Key.Code == i))
{
int tmp = i;
tmp = tmp - 32;
char Buffer[10];
sprintf(Buffer,"%c: 0", tmp);
Text.SetText(Buffer);
}
}

7
General / Any Key and Settext
« on: December 16, 2009, 07:32:01 pm »
Hi, I am new on sfml and ever in programming(game, just small things).
I have tested small things like play music and load images. I've tested now to press "a" it shows then "A: 1" (like its true) and if I don't press a then "A: 0".


Code: [Select]

if ((Event.Type == sf::Event::KeyPressed) && (Event.Key.Code == sf::Key::A))
{
Text.SetText("A: 1");
}
else if ((Event.Type == sf::Event::KeyReleased) && (Event.Key.Code == sf::Key::A))
{
Text.SetText("A: 0");
}

No i got the idea to make for all Keys from A to Z.
I know i need for() for this one, but i don't really know how.

I know it should be then
sf::Key::i and Text.SetText(i + ": 0");
But my problem is I don't know how to count keys of sfml from event. If i put my mouse on A it shows me =97 and Z = 122.
so was my idea to make
Code: [Select]

for(int i=sf::Key::A; i <= sf::Key::B; i++)
{
char Buffer[5];
//sprintf(Buffer,"%d\n", i);
//MessageBox(NULL,Buffer,"Error",MB_OK | MB_ICONEXCLAMATION | MB_TOPMOST);

if ((Event.Type == sf::Event::KeyPressed) && (Event.Key.Code == i))
{
Text.SetText(i+": 1");
}
else if ((Event.Type == sf::Event::KeyReleased) && (Event.Key.Code == i))
{
Text.SetText(i+": 0");
}

Its working but my problem is now in SetText. I don't know how to show A or B.[/code]

Pages: [1]