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

Pages: [1] 2
1
Graphics / Aligning text of different sizes based on the baseline
« on: December 21, 2011, 08:11:50 am »
Well now I feel silly. Works perfectly, thanks!

2
Graphics / Aligning text of different sizes based on the baseline
« on: December 21, 2011, 05:32:06 am »
Images are drawn relative to the upper left corner. Text rendered from a font on the other hand is usually aligned based on the "baseline" of the text which cant be calculated from any available sfml font/text properties. I am currently using the .NET bindings and I would like access to the baseline of a rendered glyph in order to align text of differing sizes. Is there some way of calculating the baseline from SFML or am I better off looking into FreeType bindings for .NET?

Basically what I'm looking for is a function which takes in a string and returns how far the baseline is from the "draw position y coordinate".

3
DotNet / Threaded window disappears, still thinks its open?
« on: December 13, 2011, 04:03:28 pm »
Even stranger. If I SetActive(false) in my minimal example, the window still disappears. If I do it together with my Gtk window, it works... I will investigate further in a bit.

4
DotNet / Threaded window disappears, still thinks its open?
« on: December 13, 2011, 06:19:38 am »
Aha! I was browsing around and saw this post in another thread

Quote

SetActive is only about drawing. A window needs to be active when you want to draw stuff. So:
- you must call SetActive(false) before launching the rendering thread
- that's all, SetActive(true) is called automatically by Clear/Draw/Display


This fixed it =]

5
DotNet / Threaded window disappears, still thinks its open?
« on: December 12, 2011, 03:33:22 am »
I am trying to use a SFML window on a separate thread from the main thread (which hosts a GTK window). Whenever I try this, the window immediately disappears. It still runs DispatchEvents, Display, Clear, and IsOpen() returns true. Am I doing something wrong?

Here is a minimal example:

Code: [Select]
   
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using SFML.Graphics;
using SFML.Window;

namespace MessageView
{
    class EntryPoint
    {
        static RenderWindow window = new RenderWindow(new VideoMode(400, 400), "test");
        static Thread thread = new Thread(run);
        static bool running = true;
        static void run()
        {
            while (running)
            {
                window.DispatchEvents();
                window.Clear();
                window.Display();
            }
        }
        static void Main(string[] args)
        {
           
            //thread.Start(); //window will immediately disappear
            //run(); //runs fine

        }
    }
}

6
Window / Getting back window focus
« on: November 15, 2011, 08:19:37 am »
Perfect!


Thanks.

Code: [Select]


[DllImport("user32.dll")]
public static extern bool SetForegroundWindow(IntPtr hWnd);

protected RenderWindow window;

public void ForceToFront()
{
    SetForegroundWindow(window.SystemHandle);
}


7
Window / Getting back window focus
« on: November 15, 2011, 07:20:40 am »
I fear I may know the answer to this question but:

I have a "console application" in VS2010 set up using SFML2.net, and whenever I boot up the game in the debugger, first VS's debug console pops up, and then the SFML window (expected). However, even though the SFML window is physically on top of the debug console, it is the debug console which retains focus. Is there any workaround for this? It means one extra click every time I debug my game.

My fear then is that this is an issue specific to VS or how windows 7 handles focus. It there any way to force the SFML window to the front? Even a system call would be fine since the console will only be there when I'm debugging it. When I remove the console the window is properly in front.

8
DotNet / SFML 2.0 with mono
« on: November 05, 2011, 11:56:38 pm »
I would like to use SFML2.0 with mono. Before I begin trying to get it to work, is this even possible?

More info:
I have successfully built sfml2 with VC++ 2010, and I've used the c++ bindings before. I see that the .net versions use the c binding. Are these available for 2.0?

EDIT2: Just saw that there's a separate repository for CSFML. Is this 2.0?

EDIT3: Got csfml to compile, now trying to get it to gel with .net

EDIT4: After 4 hours of work I got everything to work out! Renders 8000 sprites at 120fps, not too bad!

9
Feature requests / static access to mouse wheel (SFML2)
« on: August 11, 2011, 08:46:01 pm »
Ah ok. I see the confusion now. An accumulator of events is exactly what I am making. For each key I care about I increment a counter if I see it pressed this frame, and reset it to zero if I don't. This tells me if a key was just pressed this frame, is being held down, has just been released, etc. I retract my request =P

10
Feature requests / static access to mouse wheel (SFML2)
« on: August 11, 2011, 09:11:07 am »
I would imagine something like Mouse::GetWheelDelta() which returns the net number of ticks since the last time the function was called. Actually, I see now how I could just add this myself, but it would be nice to not have to catch window events manually to get it.

11
Feature requests / static access to mouse wheel (SFML2)
« on: August 11, 2011, 08:17:15 am »
Sorry, I mean rotating the mouse wheel. I would like to access whether the wheel has progressed up or down a tick statically.

12
Feature requests / static access to mouse wheel (SFML2)
« on: August 11, 2011, 07:16:33 am »
AFAIK the mouse wheel is a button just like any other. Many games treat MouseWheelUp/MouseWheelDown like any other key and let you bind commands to them. This is what I am trying to do, but I am forced to poll for them separately through window events then pass them around. Isn't this what the static input interface was made to avoid in the first place?

13
Feature requests / static access to mouse wheel (SFML2)
« on: August 11, 2011, 06:27:01 am »
Can we get static access to the mouse wheel like the other inputs in sfml2? Thanks.

14
Feature requests / SFML2 View GetRect
« on: August 11, 2011, 02:48:19 am »
Ah ok, this does make sense then.

cheers

15
Feature requests / SFML2 View GetRect
« on: August 10, 2011, 05:00:32 am »
I just recently switched to 2.0 from 1.6. The one thing I am wishing I had still is sf::View's GetRect method. Where did it go?

I was using it to only draw object which collide with the current view.

Edit: Also, it has also always seemed kind of weird to me to set the position based on the center, whereas other rectangle-like objects are usually specified by their upper left corner. This makes me have to add factors of the view's half size all over the place.

Pages: [1] 2
anything