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.


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

4
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]
anything