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

Pages: [1]
1
Graphics / Re: Anti-Aliasing of Text
« on: July 17, 2012, 09:57:29 am »
Ah, I see! Thanks for clarification. :)
I'll look into recompiling everything, but not right now. I'm fine for now, knowing it is possible. :)

2
Graphics / Re: Anti-Aliasing of Text
« on: July 16, 2012, 01:56:14 pm »
Quote
I can disable antialiasing easily
Sorry, but I'm unaware of how you did that. Could you please elaborate? I'm using SFML.net if that's of any importance here, btw. :(

3
Graphics / Re: Anti-Aliasing of Text
« on: July 12, 2012, 03:04:24 pm »
I also added the source:

        static void Main(string[] args)
        {
            RenderWindow window = new RenderWindow(new VideoMode(640, 480), "Test");
            window.Closed += new EventHandler(OnClose);

            // Load a sprite
            Texture texture = new Texture("cute_sprite.jpg");
            Sprite sprite = new Sprite(texture);

            // create a string
            Font terminalscope = new Font("terminalscope.ttf");
            Text text = new Text("This is a test of font in front of a sprite", terminalscope);
            text.Color = new Color(0, 0, 0, 255);
       
            // run as long as the window is open
            while (window.IsOpen())
            {
                // check all triggered events since last iteration
                window.DispatchEvents();
               
                // clear screen
                window.Clear();

                // draw sprite
                window.Draw(sprite);

                // draw text
                window.Draw(text);

                // update window
                window.Display();
            }
        }

[attachment deleted by admin]

4
Graphics / Re: Anti-Aliasing of Text
« on: July 12, 2012, 01:53:35 pm »
Hej,

Quote
try to set x and/or y position on float coords (+= 0.375,  += 0.5)
I tried that but it didn't really improve anything. In fact it appeared to me even more blurred.

Quote
Can you show a screenshot? Antialiasing cannot be disabled for text, but you shouldn't need to do that.
Yeah, sure. I added it as an attachement.

Quote
Maybe I'm missing something but why can't you just use a really simple looking font??
I'm using this font here: Terminalscope

[attachment deleted by admin]

5
Graphics / Anti-Aliasing of Text
« on: July 12, 2012, 10:04:35 am »
Hey there,

I'm making a game with very simple graphics and the default anti-aliasing of the text is really unfitting.
Is there a way to render the text without any anti-aliasing at all? I've been looking through the documentary and haven't found anything.

Thanks in advance :)

6
DotNet / Keyboard input - restrict to one key at a time
« on: July 09, 2012, 10:07:09 am »
[edit: solved, I guess]

Hi there,

I'm currently developing a game using SFML.net and it's been going smooth for quite a while.
My problem now is that by holding one direction key and then pressing another, the player can walk one more tile than he should be able to. Here's the corresponding code for reference:

Code: [Select]
static void OnKeyPress(object sender, EventArgs e)
        {
            if (Keyboard.IsKeyPressed(Keyboard.Key.Numpad7))
            {
                player.move(-1, -1);
            }
            else if (Keyboard.IsKeyPressed(Keyboard.Key.Numpad8) || Keyboard.IsKeyPressed(Keyboard.Key.Up))
            {
                player.TileID = TileSet.Up;
                player.move(0, -1);
            }
            else if (Keyboard.IsKeyPressed(Keyboard.Key.Numpad9))
            {
                player.move(1, -1);
            }
            [...]
}

[...]

MainWindow.KeyPressed +=new EventHandler<KeyEventArgs>(OnKeyPress);
And so on.

Is there a special way to do things? Before SFML.net I've been using methods like Console.ReadKey() that pause the program until they are given one key. I've been trying to accomplish something alike using a GameState variable that I would set to PAUSE before I enter a loop in which the key presses are being handled and then return PLAYING, but that only stopped my program from exiting correctly (debug still running, music still playing, ...) when I closed the window.

Any help is appreciated as I'm still quite a newbie. Also if you need more information ask straight away. :)

-------

Well... As I read through the forums a bit I noticed something about these GameStates I previously had been missing out: You should also check within the method handling the input wether the current State is accepting keys. I previously completely forgot about that. Also, I just left out the extra loop now and all the previous problems about not exiting correctly stay gone. Sorry about this new thread, but maybe it can help someone in the future. :D

Also I'd be interested in the "professional" way to handle keys. I'm not working after a big plan here - just thinking and improvising; then optimizing my way out of the mess I created in the first place. :)

Pages: [1]