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

Pages: 1 [2] 3 4 ... 7
16
Graphics / Re: rotating and THEN scaling sprite
« on: August 13, 2009, 04:32:24 pm »
Quote from: "thoniel"
but if i do that directly by sprite.rotate and sprite.scale, it seems that it order is always scale and then rotate.
How can you tell what "order" it was done in, and why does it matter?

The only thing I can think of is the center point of the operations, which should be trivial to change or account for.

17
Graphics / Random sf::String?
« on: August 11, 2009, 01:07:36 am »
You could try something like:
Code: [Select]
char random = 'a' + sf::Randomizer::Random(0, 25);For a random letter from 'a' to 'z'.

18
Graphics / SFML 1.4: SetScaleX does not appear to be working
« on: August 09, 2009, 12:02:46 am »
Quote from: "Laurent"
Well, I think that it can be confusing for many users, especially beginners. But you're right, that could be useful too. I'll think about it for SFML 2.0.
Thanks, I do hope you'll change it.

Scaling by any number goes from 0,0 and rotation also goes from 0,0. I think users would expect that scaling by a negative number does also. Also, scaling by a negative works like that in any other system.

19
Graphics / SFML 1.4: SetScaleX does not appear to be working
« on: August 08, 2009, 07:38:34 pm »
Quote from: "Laurent"
The FlipX and FlipY functions just flip the image without altering the sprite's geometry. Using a negative scale would invert the quad's coordinates, so instead of being drawn in (0, 0, width, height) it would be drawn in (-width, -height, 0, 0).
That's exactly what one would expect when using a negative scale. Also, what if the user uses SetCenter? Then they could choose where to mirror at, which may be useful.

The thing that gets me, though, is that Drawable abstracts position, scale, rotation, etc very well. Mirroring belongs in there as well. In my game I'm actually using glSetScalef in a few places, so this would be quite useful for me, personally.

20
Graphics / SFML 1.4: SetScaleX does not appear to be working
« on: August 08, 2009, 06:51:18 am »
Quote from: "Laurent"
negative scales are not allowed.
What is the reason for this?

It seems like mirroring should be abstracted to the sf::Drawable base class.

21
General / CEGUI SFML Render Module.
« on: August 05, 2009, 06:14:49 am »
What advantage do you expect over the OpenGL render module?

22
Graphics / Cascade of transformations inheriting from Drawable?
« on: June 11, 2009, 09:17:18 pm »
It already works that way. Anything drawn inside of a Drawable's Draw function has its matrix multiplied.

The problem you'll run into next is Z order. OpenGL would handle that too, for free, but I don't know of a good fix with SFML. I found it odd that SFML supports shaders (which my target audience won't have support for) but not Z buffers (which has been supported for-nearly-ever).

See:Manually setting Z-order

Another problem you may have is transforming mouse coordinates down several hierarchy levels. Although SFML has functions for this, they're broken after one level.

IMHO, SFML's biggest limitations for graphics right now is no Z order support and no matrix abstraction. I've found straight OpenGL a viable alternative for specific applications (characters) and SFML's sprites good for general purpose stuff.

Just my two cents.

23
Graphics / Unsetting a Sprite's Image
« on: June 09, 2009, 06:43:47 am »
Well, you could always just not draw the sprite...

Or perhaps you just don't even have sprites you don't need. You could use a linked list or vector to store only as many sprites as you actually have digits, while adding/removing as needed.

Sorry, since that doesn't address your question of unsettling images at all. :)

24
Graphics / upside-down textures in OpenGL
« on: May 26, 2009, 12:27:53 am »
I think that texture coordinates go with the geometry coordinates. So if your geometry has the Y axis pointing down, your texture coordinates should too.

25
SFML may be messing up your OpenGL states, if you haven't set PreserveOpenGLStates(true). Or you could just be sure to set your OpenGL states each frame on your own (instead of once at the beginning of your program).

Or maybe that's not even your problem...

26
Graphics / Mirrored text
« on: May 21, 2009, 09:22:48 am »
So any chance of changing it? A negative glScalef does mirror, so some people might expect it.

It's a bit annoying to have to change the view port to mirror something.

Thanks.

27
Graphics / Rotated SubRect
« on: May 21, 2009, 02:53:27 am »
I'll probably just modify or subclass sf::Sprite. A rotated sub-rect is just a small change in the texture coordinates in the Render function. That's how FlipX and FlipY work.

It would be nice if SFML supported this. I know a lot of texture atlases support rotating sprites to save space.

Thanks.

28
Graphics / Mirrored text
« on: May 21, 2009, 02:50:24 am »
Is there any chance that in the future SetScale(-1) will work for mirroring? It should just be a small change in the way your matrices are calculated.

Thanks.

29
Graphics / Mirrored text
« on: May 20, 2009, 01:12:11 am »
Is it possible to mirror sf::String? I expected SetScale(-1.0f, 1.0f) to do it, but it seems to have no effect.

Thanks.

30
General discussions / Copy semantics of resources
« on: May 18, 2009, 10:57:04 pm »
If you don't want to copy the images, uh, then don't copy them. Having a copy constructor is useful for the people who need it. (I've used it to copy and then modify an image, for example.)

Perhaps, to fix your bug and prevent it from happening again, you should instead be using plan old pointers. For my game, I store pointers for all loaded images in one map. Then, when I need an image, I just grab the pointer from the map. It's quite difficult to accidentally copy an Image from a pointer. Smart pointers aren't needed, as long as you understand only one part of your code is responsible for cleaning up.

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