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

Pages: 1 [2] 3 4 ... 6
16
General / A * help!
« on: October 02, 2010, 03:38:05 pm »
No one?

17
Graphics / Detecting is mouse is over String
« on: October 02, 2010, 03:32:22 pm »
Well. This one is C++ but I think it will help you :)
Code: [Select]

bool MouseOver(sf::String &String)//overload with sf::String
{
if ( MouseX > String.GetRect().Left && MouseX < String.GetRect().Right)
{
if ( MouseY > String.GetRect().Top && MouseY < String.GetRect().Bottom)
        return true;
}
else
return false;
}

18
General / A * help!
« on: October 01, 2010, 07:09:05 pm »
Hey.
I try to implement path-finding for my game. Inspired of some threads here I'd like to try the A* - Pathfinding! I read a few articles about it but I don't really get it. Could someone show me some source? I don't really how to implement the algorithm with c++!
thx,
Finn

19
Window / How to use the ConvertCoords() function proberly
« on: September 30, 2010, 07:23:49 am »
Thx :) Dynamic drawing is only be used for sprites, so no problem :) But why doesn't it work with Drawables?

20
SFML projects / Sketch RPG
« on: September 29, 2010, 10:10:37 pm »
A new video coming the next few days! Mapeditor isn't finished or in a good usable state, but still many things changed and were improved!

21
Window / How to use the ConvertCoords() function proberly
« on: September 29, 2010, 07:39:15 pm »
Thx :)
Works!

But with checking the position it's not as it should be.
I check the Position, so only the top left corner of the sprite.
Even though the sprite is in sight it isn't displayed because the position of the sprite is outside the view.

I tried something like this to get rid of this problem:

Code: [Select]

bool IsInSight(const sf::Drawable &Drawable, sf::View &View)
{
int X = Drawable.GetPosition().x;
int Y = Drawable.GetPosition().y;
int Width = Drawable.GetScale().x;
int Height = Drawable.GetScale().y;

sf::FloatRect Rect(X, Y, X+Width, Y+Height);
sf::FloatRect ViewRect = View.GetRect();

//check if the sprite is in the view
if(ViewRect.Intersects(Rect))
window.Draw(Drawable);
}


But it's just the same :-/ Suggestions?
Finn

22
Window / How to use the ConvertCoords() function proberly
« on: September 29, 2010, 04:29:07 pm »
No one knows how to do that?  :shock:

23
Graphics / Trying to change cursor
« on: September 28, 2010, 09:56:13 pm »
To do it perfect: Just use .png with a transparent background! Then you don't have to worry about it and even need some less codelines ;)

24
Window / How to use the ConvertCoords() function proberly
« on: September 28, 2010, 05:48:17 pm »
I'm trying to do some dynamic drawing. Means: Everything that is on a position you can't see at the moment won't be displayed. For this purpose I'd like to ask, how to use the ConvertCoords() function. Without views I'd do:
Code: [Select]

bool DynamicWindow::IsInSight(const sf::Drawable &Drawable)
{
int X = Drawable.GetPosition().x;
int Y = Drawable.GetPosition().y;

if(X < 0 || X >= m_Width || Y < 0 || Y >= m_Height)//check if the Drawable can be seen
return false;
else
return true;
}

where m_Width and m_Height the size of the displayed window is. But this doesn'T work with views! Help please :P

25
Graphics / Trying to change cursor
« on: September 26, 2010, 07:35:10 pm »
Code: [Select]

while(App.IsOpened())
{
    //GetTheInput...
   
    Sprite.SetPosition(MouseX,MouseY);
   
    App.Clear();
    App.Draw(Sprite);
    App.Display();
}

26
General / [C++] sf::RenderWindow
« on: September 24, 2010, 09:43:51 pm »
Or use sf::RenderTarget as a parameter instead of sf::Window

27
Graphics / Button
« on: September 22, 2010, 06:57:23 pm »
Code: [Select]

bool MouseOver(sf::Sprite &Sprite)//returns true if the mouse is over given sf::Sprite
{
float XPos = Sprite.GetPosition().x;//the x position
float YPos = Sprite.GetPosition().y;//the y position
float XSize = Sprite.GetSize().x;//the width
float YSize = Sprite.GetSize().y;//the height

if(MouseX >= XPos && MouseX <= XPos+XSize && MouseY >= YPos && MouseY <= YPos+YSize)
return true;

else
return false;
}

28
SFML projects / Sketch RPG
« on: September 16, 2010, 09:01:17 pm »
Well this would be really great. But I think it's more than my skills allow me to do :P This would go over to artificial neuronal networks section.
Actually I'm taking a seminar to this kind of informatics, but I don't think I'll be able to do this in a short time. So this won't be a feature of this game. But it's a great Idea! Maybe I'll try something like this after I completed the seminar for artificial neuronal networks. ;)

But for now a update:
Map-system is almost done. I'll just finish my selfmade map-editor and then paste a new video on youtube ;)

29
SFML projects / Ball Defender!
« on: September 15, 2010, 09:29:20 pm »
What about a Linux build? :)

30
Network / Server Client managment
« on: September 15, 2010, 07:42:02 pm »
Normally you just tell the server that you want to move. Then the server checks if you may move and if so he sends the new position to the clients

Pages: 1 [2] 3 4 ... 6
anything