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

Pages: [1] 2 3 ... 12
Graphics / Re: Line Spacing
« on: June 26, 2013, 10:36:51 pm »
No, sf::Text always uses the line spacing defined by the font. Why would you like to change it?
Replying to this because it turned up in a search for the same question.  I'd want to change it because the default for the font I'm using is too large.  It seems like a reasonable thing to have access to in the font class.

General discussions / Re: A new logo for SFML
« on: April 30, 2013, 12:53:33 am »
Hey, just wanted to say congrats on getting this out.  It's a great project that I've made good use of.

Feature requests / Collisin Detection
« on: March 16, 2009, 11:08:06 pm »
Quote from: "Wavesonics"
There is plenty of math tools in right now, like checking if 2 sprites overlap, and Vector 2D, just use that as a base, and format the lib like SFML. Thats all I mean. Like a CD lib that takes SFML sprites and uses their data to do CD.

That would amount to little more than an OBB-to-OBB overlap test.  Such a simple function might be worth including, except then people who don't understand CD would start complaining that it's not "pixel-perfect" or something.  Implementing a "pixel perfect" test is a bad idea since it's a stupid, stupid way to do CD and would quickly start bogging down any CPU.
Breaking down visible sprites into polygonal/circular collidables (the correct way to do CD) is clearly beyond the scope of SFML.

Edit:  I suppose I could publish my 2D CD library to the wiki if someone wants light-weight 2D CD without a full physics simulation (Box2D).  But breaking up the sprites into polygons will always be the responsibility of the user since automating that task is not even remotely trivial.

Feature requests / Reset function for sf:Sprite
« on: February 16, 2009, 05:48:24 pm »
Quote from: "Laurent"
Do that if you want to:
- get more work when upgrading to a new version of SFML, just to put back all your modifications
- make sure people won't be able to compile or run your program unless they get your version of SFML

Good points.  But merging something like that is not that difficult.  As for people not being able to compile/run it, I guess that's true; but who really distributes software with instructions to go obtain some libraries before it will run?

Edit:  Setting the scale to (0,0) in your sample reset function seems like a bad idea...   :wink:

Feature requests / Reset function for sf:Sprite
« on: February 16, 2009, 05:57:36 am »
Quote from: "Nexus"
Besides that, you can easily add functionality to sprites by writing free functions. I did that, too, for example:

Code: [Select]
void AlignCenter(sf::Sprite& Sprite)
Sprite.SetCenter(Sprite.GetSize() / 2.f);

Eww...  yuck.  Just edit the SFML source if you want to add that.

General / App.Close();//Does it free memory used by resources?
« on: February 13, 2009, 09:10:53 pm »
Quote from: "Astrof"
kinda similar to the above question, but if I have a class that stores Images and such, and I close the program (close the exe) is the memory freed? I guess this is a basic C++ question, but just want to know if I don't explicitly use delete on pointers, does the program delete the data it's using (or like does the OS know that the memory used by the now dead program is available)

To cleanly shutdown an app, you should delete all dynamically allocated memory before closing.  If you don't, the OS will *probably* reclaim the memory anyway, but there's no guarantee and it's considered an ungraceful exit.

General / Single instance of a class
« on: February 11, 2009, 05:47:21 pm »
One thing to keep in mind though is that a singleton is a "quasi-global" and, as you've probably heard, globals should be avoided.  The reason is it becomes tempting and easy to access it from anywhere instead of maintaining reasonable dependencies.
Or put another way, think before you type "#include "MySingleton.h" if you should really be binding those 2 modules together or if there's a way to do what you need without creating that dependency.
(A situation where everything is dependent on everything is pejoratively called "spaghetti code.")  But I think a lot of people who think singletons inherently cause spaghetti code have never seen truly hideously intertwined code.  Such as years-old government projects that have been tossed from company to company with each one not giving a rat's ass about the code's maintainability after they fix their stuff and get it out the door...

Graphics / class MyPicture - Copying Image to Sprite...
« on: February 10, 2009, 07:38:13 pm »
Quote from: "JeZ-l-Lee"
This class is taken from the sprite tutorial. You should read the corresponding paragraph to understand what it's used for ;)


I've wasted about 10 hours on trying to load a Sprite Image and then setting the center so that scaling and rotations will be centered.

I read the paragraph and do not understand.

Please help!

I think you're in the wrong thread.  Laurent already explained in the other thread that the center point does not take into account scaling and rotation.  So will need set the center point at the center of the untransformed sprite to get the effect you want.
Also, as other people have mentioned, you're probably biting off too much by trying to make an SFML-powered game without learning basic C++ first.  You might figure it out eventually, but you're doing it the hard way.  Either way, good luck.

Edit:  I guess that's what happens when I reply to a post over the course of several hours.

General / Single instance of a class
« on: February 10, 2009, 06:40:50 am »
Quote from: "spackle"
Then after you look up singleton, forget you looked it up. If you only want one instance of a class then only create one instance. Its just that easy. See http://scientificninja.com/advice/performant-singletons for more information.

There are good reasons to use singletons.  Such as learning to write code before learning about design perfection.

Graphics / Re: .SetCenter(float CenterX, float CenterY);
« on: February 10, 2009, 05:22:59 am »
It's probably working, but just not behaving as you expect.  How are expecting it to function?

Audio / 1/2 Second Delay in Sound playing... Any Ideas ???
« on: February 06, 2009, 04:50:14 am »
It's most likely the time it takes to load the media from the hard drive.  If you load the sound ahead of when you need it, it should play immediately.

Quote from: "Core Xii"
Those are some really nice intro pictures. Now all you need is the game. :roll:

That's a really nice sharp tongue.  Now all you need is not to be an asshole.

General discussions / SFML 2.0
« on: February 05, 2009, 03:52:51 pm »
Quote from: "Laurent"
I'll do my best to include all the interface changes in SFML 2.0. I hope to be able to provide backward compatibility after that.

I was referring more to the SVN builds, which I understand are all WIP and such.  But if you already know an interface change that will be necessary, I think it's better to go ahead and make it sooner rather than later if possible.

General discussions / SFML 2.0
« on: February 05, 2009, 06:06:37 am »
Sent to your email.  I also included uses of AlphaMasks/ RenderMasks for texture blending and texture shadowing.
Also, as far as changing the interface, do you know yet what changes will be necessary?  If so, making as many as them as possible immediately might be better then incrementally changing the interface.  I'd prefer a one-time transition than having to modify my code everytime I update.  (Although I certainly understand it's not possible to anticipate every possible interface change you may need.)

General discussions / SFML 2.0
« on: February 04, 2009, 07:52:10 pm »
Quote from: "Laurent"
Yes, I'm interested. Can you send me your implementation?

I just remembered that I'd forgotten about this...  Now I just need to remember when I'm home.

Pages: [1] 2 3 ... 12