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.


Topics - NON

Pages: [1]
1
General / Drawing over previous drawing
« on: December 04, 2012, 10:44:26 pm »
Hello
In my game I have a function asking the player for number. I use it in the game's options menu among other things. It can look like this:
"PROJECTILE DELAY (ms) : 25"

And when you press return with this one selected, the player can modify this number, it should look like this:
"PROJECTILE DELAY (ms): 25_"

Where the "_" is the cursor for editing the number.

I recently switched from SDL to SFML 2.0, which I'm mostly very happy about. But I'm stuck on this function.
In SDL, the calling function first rendered its things (options menu), then called the number query function with parameters given for where to draw the number while its being typed. The query function simply drew the number over the background left from the calling function.

SFML's "philosophy" seems to be that everything should be drawn at once from a cleared screen. This gives me a problem here. The query function doesn't know anything about the background images.

One solution I see is to have the query function take a screen shot, using sf::RenderWindow::capture(). Saving that to a png file. Then load that to a texture, and render over that while the player edits the number. But it just seems... dumb somehow :P

How can I do this? What about my idea?

Can I capture the screen and use that for drawing directly, instead of having to save it to a file first?

2
Window / No "Colon" in sf::Keyboard::Key ?
« on: November 26, 2012, 07:39:36 pm »
As topic says.

Why is there a sf::Keyboard::SemiColon, but no sf::Keyboard::Colon?

Am I missing something?

3
Window / Key repeat behavior
« on: November 23, 2012, 01:45:09 pm »
Hi
I have a game (Roguelike) that I'm considering migrating from SDL 1.2 to SFML. I've heard great things about SFML in general, and it seems to suit me perfectly. But there's one thing I'm concerned about that I can't find an answer to.

I want the key repeat to behave just like when typing text in Windows and Linux, i.e. when user holds down a key, there is one "event" (letter typed/player character moves, or whatever), then a small delay before repeating starts. In SDL this is controlled by "SDL_EnableKeyRepeat(int delay, int interval)".

I don't care so much about the specific delay or interval timings, but it's important for me that the behavior of it is such as I described above. I'm hoping I don't have to write my own code to handle this.

So how does it work in SFML? Happy for a fast response as I'm eager to try it! :D

Pages: [1]
anything