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

Pages: [1] 2
1
Graphics / Could somebody please elaborate on Sprite.SetCenter()?
« on: February 20, 2012, 05:45:14 pm »
Sorry, I was taking a break from my project for a few days.  I just now used some modifications with the sprites tutorial, and combining it with what you said, figured out what was going wrong in my project (in theory).  Apparently the position properties interact with the center/origin of the sprite, not necessarily the upper-lefthand corner.  This would be the reason you were saying it was supposed to translate like that without the position being reset; therefore it has to be immediately translated right back to where it was before the rotations occur, taking what was done previously for the 0,0 center and adapting it to whatever the center is now. (if it's supposed to just spin around in place).  Thanks for the help, Laurent!

2
Graphics / Could somebody please elaborate on Sprite.SetCenter()?
« on: February 18, 2012, 06:16:13 am »
Hello.  Sorry for asking such a rudimentary question, but I've read the appropriate tutorials and documentation, as well as played around with it some, and I haven't been able to figure it out so far.  Could somebody please elaborate on Sprite.SetCenter()?

The reason I'm asking this is that it seems to be doing a lot more than I'm able to figure out.  It looks like it's basically supposed to set the center of rotation (the tutorial also says translation and scaling), but it's doing a lot more than just telling Sprite.Rotate() what point to rotate the image around.  If I set it to the center of the sprite, for instance, and then try to rotate it, the sprite does NOT necessarily rotate around its center.  Furthermore if I set it to the center of the sprite and don't try to rotate it or anything, the sprite's position automatically translates about half the sprite's width and height?

?  This has confused me severely.  I have worked with graphics before, and I am certainly familiar with rotation, translation, and scaling, but I'm having a lot of trouble seeing what Sprite.SetCenter() is really doing.  The only stuff I've been able to find basically just says that it sets the center for translation, rotation, and scaling, but as it's doing what seems (on the surface, in the eyes of an SFML nubie) a bunch of different, random things, I really need a more thorough description of what this function is.  Any help would be appreciated.  Thanks!

3
Window / Passing the RenderWindow's address around.
« on: February 16, 2012, 01:20:12 am »
I think it's having something to do with trying to pass it around in threads?  Does it have any trouble on that front?

4
System / How to use threads with class member functions.
« on: February 15, 2012, 05:43:31 pm »
Thanks, Nexus!

5
System / How to use threads with class member functions.
« on: February 15, 2012, 05:34:45 pm »
Well, I did manage to get it working with static functions, but what if I want to use a function specifically associated with that object without having the class inherit from Thread?  Is there a way to do this?

6
System / How to use threads with class member functions.
« on: February 15, 2012, 05:29:26 pm »
I DID read the tutorial.  I practiced it and everything.  There was stuff in there for using them with function pointers to globally-defined functions, as well as inheriting a class from them.  But as for not using inheritance and just passing a function pointer to a class function, there's really no reference there.  I've tried it myself and haven't been able to get it to wrok.

7
System / How to use threads with class member functions.
« on: February 15, 2012, 04:52:19 pm »
1.6

8
Window / Passing the RenderWindow's address around.
« on: February 15, 2012, 04:51:42 pm »
Thanks.  I'll have to wait for a while to be able to try that out.  Will it work normally in that case?  I'm having trouble right now remembering what went wrong, but there was some kind of severe runtime issue when using pointers, especially when doing so between threads.

9
Window / Passing the RenderWindow's address around.
« on: February 15, 2012, 02:03:16 am »
Hello.  Last week I was trying to use a pointer to my RenderWindow class inside my Engine to allow multiple parts of my program to work on it at once.  Essentially one class would take care of graphics, another class would take care of events, and both would use the same RenderWindow object.  However I could never get this to work right.  It was like SFML was specifically designed to keep that from happening.  Is there a way to do this?  Thanks!

10
System / How to use threads with class member functions.
« on: February 15, 2012, 02:00:41 am »
How do you use threads with class member functions?  If I pass a function pointer to a global function to a new Thread object, that works fine.  If I try to pass a function pointer to a member function inside of a class, that doesn't work out too well.  What's the syntax for it?  Thanks!

11
Graphics / In what directory does Image::LoadFromFile() search by defau
« on: February 10, 2012, 06:37:40 am »
Uh, sorry guys.  Apparently the problem was way off in a completely unrelated part of my code.  I don't know how I didn't pick up on that pretty quickly; I guess I probably just changed something else at the same time as adding that LoadFromFile() function in, and then forgot that I had changed it.  Still I know how to use a debugger and everything, so it's kind of strange.  Sorry about that.  Thanks for the help!

12
Graphics / In what directory does Image::LoadFromFile() search by defau
« on: February 10, 2012, 06:23:27 am »
Something I probably should've posted on my last reply is that I've also tried feeding it the absolute path and filename, and it still doesn't work.  ...Which makes me start to think the path isn't the problem?

13
Graphics / In what directory does Image::LoadFromFile() search by defau
« on: February 10, 2012, 05:58:03 am »
I've got a copy of the file in <program>, bin, and Debug (see the path above).  I've checked on the name of the file, and it matches the string in the code exactly.  However it's still crashing for some reason.  The IDE by the way is Code::Blocks.

14
Graphics / In what directory does Image::LoadFromFile() search by defau
« on: February 10, 2012, 05:37:37 am »
Real simple question:  Let's say I've got my executable in C:\Users\username\program\bin\Debug.  Let's also say I've got the next bit of code:

Code: [Select]

space.LoadFromFile("space.png");


where space is an Image.  What directory would space.png have to be in for it load properly?  Thanks!

15
Window / How can you avoid showing the console in the background?
« on: February 09, 2012, 07:20:41 pm »
It's Code::Blocks.  Thanks though for the last reply.  As for the first one, that's kind of interesting; evidently a blank project maps directly to a console one?

Thanks for the replies.

Pages: [1] 2