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

Pages: [1] 2 3
1
Graphics / Re: Shape position problem
« on: November 13, 2012, 07:56:59 am »
So i tried to change to 2.0 and made it compile but the linking doesnt work to good for me.
Got the
"The application failed to initialize properly (0xc0150002). Click on OK to terminate the application."-error I heared some other people been having on vs 2010, is it the same on vs 2005? Do I need to compile sfml myself? I have tried both with static and dynamic.

sorry for making this thread into some general help-regen-out-thread:(

2
Graphics / Re: Shape position problem
« on: November 12, 2012, 02:08:41 pm »
So I am back again after a few years with the same problem=/

I want to drawa bunch of dots connected by lines.
First the dots:
   m_shape = Shape::Circle(pos, 5, Color(255, 100, 100));
   m_shape.SetPosition(pos);

Then the lines:
   Vector2f n1Pos = n1->GetPos();
   Vector2f n2Pos = n2->GetPos();

   m_shape = Shape::Line(n1Pos, n2Pos, 3, Color(200, 200, 200));
where n1 and n2 are two list iterators to dots and GetPos is defined as
return m_shape.GetPosition();

These are drawn like this:
   //drawall edges
   for(list<Edge>::iterator it = m_edges.begin(); it != m_edges.end(); it++)
   {
      m_app.Draw(it->GetShape());
   }

   //draw all Nodes
   for(list<Node>::iterator it = m_nodes.begin(); it != m_nodes.end(); it++)
   {
      m_app.Draw(it->GetShape());
   }

The problem is that all the lines are showing up fine but the dotsare not showing.
 If i remove the
   m_shape.SetPosition(pos);
from the dot constructor, it's the opposite :o

3
Graphics / Re: Shape alpha color alter other colors?
« on: September 07, 2012, 02:34:12 pm »
Worked perfectly:) Thanks a lot!

Is there any easy answer to why they are modulated? why it is made this way?

4
Graphics / [Solved] Shape alpha color alter other colors?
« on: September 07, 2012, 02:21:45 pm »
There is probably some easy answer to this but i have not found any answers around here.

So I have this random color, m_color. R/G/B is set 0-255 and A is always 255.
I have a shape that is set to this:
m_shape = Shape::Circle(0, 0, m_size, m_color, m_wall, Color(0, 0, 0));

This works great! But at a certain point I want to shape to fade away. So I do this from time to time when i update:
m_color.a -= 5;
m_shape.SetColor(m_color); //TODO: check why they change color?!?
 

Sooo, as you can see by my comment, the color is changing, this only happens the first time I run the code above, afterwards the shape is fading away in a nice way.
It looks like it's allways changing into a darker color?

My background color is all white, alpha = 255.

Anyone have any idea? I could add all the code here if you want, I just thought this would be enough to start with.

5
Graphics / Shape position problem
« on: May 28, 2009, 02:22:50 pm »
Ahhh, thank you so much! of cause it is!:)

6
Graphics / Shape position problem
« on: May 27, 2009, 09:19:21 pm »
hi, havn't been using sfml for a while now and started some days ago and I stumbled on the same problem, kinda.

i want a sprite to follow the mousepointer using the following code:

Quote
sf::Vector2<int> Temp = GridCord(App);
hoverBlock->GetSprite().SetPosition(Temp.x, Temp.y);


where GridCord(App) returns a position on screen relative to the mouse (which is tested and correct). but the sprite doesn'nt move:(

why?

7
General / width of rectangle
« on: May 24, 2009, 11:02:36 pm »
Hi, I have a rectangleshape and now i want to get the width and height of it.

i have a function called:
bool ClickedShape(sf::Shape shape, sf::RenderWindow *App, bool click)

but it doesnt seems like I can access getwidth() of my "shape", why?

8
Graphics / Shape position problem
« on: October 06, 2008, 08:59:03 pm »
So the GetPosition is only relative to the shape itself?
Sorry but i dont really follow you, is'nt it any function that return the shapes position in the renderwindow?

 :oops:

9
Graphics / Shape position problem
« on: October 06, 2008, 08:34:19 pm »
hi!

when i using shapes a get a wierd problem. when i want to look up where they are, GetPosition().x and .y is allways 0.
Right now I am using circles and this i my code:
Code: [Select]
float Plupp::Distance(Plupp *Other){
sf::Vector2<float> ThisCords = this->Shape.GetPosition();

float Dist = sqrt(pow((this->Shape.GetPosition().x - Other->GetShape().GetPosition().x),2)
+ pow((this->Shape.GetPosition().y - Other->GetShape().GetPosition().y),2));

std::cout << ThisCords.x << std::endl;
std::cout << ThisCords.y << std::endl;

return Dist;
}

This is my code to massure the distance between 2 "plupps". The both plupps thinks they is standing on top on eachother even if they is half a screen apart! my output from this is 2 zeroes. I have been having this problem before and i belive I gave up that time.
thanks in advance for any help!

edit: ops, maybe this could be in graphics :oops:

10
General / Entry Point Not found
« on: August 25, 2008, 09:24:02 pm »
Hi, I have recently formatted my computer and yesterday installed visual studio 2008 and sfml. I have done this before without problem and read trough the tutorial for visual studio.
When I am trying to run the code in the first tutorial (the clock thing) i get a error message. And I have not been able to get any code with sfml to work....always this error message.

"The Procedure entry point ??0Clock@sf@@QAE@XZ could not be located in the dynamic link library sfml-system.dll"

I have tried with -d -s also.

anyone know what might be the problem?

edit: oh, release seams to work...but not debug

11
General / [Solved] thread problem
« on: August 08, 2008, 09:30:29 am »
ahhhh, thanks a lot! works now:)

12
General / [Solved] thread problem
« on: August 07, 2008, 02:11:08 pm »
I have a server-client application. The server is suppsoed to identify the client connecting and then start the acording thread for the client, after that it should continue to lissen for other clients. This is a part of the code:
ClientIncomming() is returning the client-socket to the global variable Sock.

   
Code: [Select]
do{
Client = ClientIncomming(4567);
Client.Receive(Pack);
Pack >> Type;

if(Type == "Boss" && !BossThread){
sf::Thread Boss(&Boss);
Boss.Launch();
}
else if(Type == "Shooter" && !ShooterThread){
sf::Thread Shooter(&Shooter);
Shooter.Launch();
}
else if(Type != "Boss" || Type != "Shooter")
std::cout << "Undefined Client tried to connect, rejected" << std::endl;


}while(1);


The thing is...the threads dont really act like threads, they act lika normal functions...

anyone have any idea? please ask me if you want some other part of the code.

13
Network / closing a TCP socket
« on: August 04, 2008, 01:14:47 pm »
Ah, thats true, i have closed the copy. thank you!

14
Network / closing a TCP socket
« on: August 04, 2008, 12:39:25 pm »
Hi, What can cause this to happen:
"Failed to close socket"

it is this little line that wont work:
Code: [Select]
if(Client.IsValid())
     Client.Close();


the only thing the socket was used for is to get a clients socket, then copy it to another socket.

15
Feature requests / sf::thread
« on: August 01, 2008, 11:59:16 am »
I think it would be nice to add a function to the sf::thread class.
A IsRunning() thingy.
I know the tutorial suggests to have a globel bool called ThreadRunning, but if you have alot of threads i could be messy, i dont like to use globals at all :?

Pages: [1] 2 3
anything