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

Pages: [1]
1
DotNet / Re: Question about Input
« on: April 15, 2012, 06:06:22 pm »
Are there any plans for a way to determine if a window has focus? (Aside from hooking the events)
The events work, but not perfect...   

On application start I either have to assume the window is focused, or assume it is not.

It is possible for an application to start without focus.   For example, if your application starts while the Start Menu is open or if the user launched the game from a dock application installed (RocketDock, StarDock, etc).

When this happens LostFocus isn't raised so my game logic believes the window is focused, when in fact, it is not.

Minimal example of how I'm determining if the window is focused.

Code: [Select]
bool isFocused = true;
window.GainedFocus += (s, e) => isFocused = true;
window.LostFocus += (s, e) => isFocused = false;

Code: [Select]
if (isFocused)
{
     // Handle Keyboard/Mouse Input
}


2
DotNet / Question about Input
« on: July 20, 2011, 01:13:42 am »
Quote from: "Nexus"
By the way, is it "focused" or "focussed"? Seems like both forms exist, which one is more widely used?


I've personally never seen 'focussed', and Firefox spell check apparently hasn't either.

According to Wiktionary 'focussed' is a UK alternate spelling.

3
DotNet / Question about Input
« on: July 19, 2011, 10:24:54 pm »
Quote from: "Laurent"
It is a possibility, indeed.


That would be excellent.    

Thanks for the quick response btw.   :)

4
DotNet / Question about Input
« on: July 19, 2011, 09:47:55 pm »
I was really hoping this wasn't the case,  I really prefer IsButtonPressed over events in a lot of cases.   However, I can also understand the reasoning behind global input state as well...

Is there any possibility of a window.IsFocused at any point in the future?  
I realize I can accomplish this with focus events, but seems like it would be a nice addition to the window class itself.

5
DotNet / Question about Input
« on: July 19, 2011, 12:47:43 am »
I updated to the most recent revision of SFML 2 .NET today and have noticed a little different behavior from the Input class.

Previously window.Input.IsMouseButtonDown only returned true if window was active.

In the new version, Mouse.Input.IsButtonPressed returns true regardless of the state of the window.

What is the proper way to determine that a window is the active window?
(or am I missing something obvious here?)

6
DotNet / System.Drawing.Color Predefined Colors
« on: July 18, 2011, 06:30:44 pm »
I've always found the predefined colors in System.Drawing.Color to be very useful so I added them to the SFML color class.  
I decided I would post them here in the event that someone else finds them useful.


Code: [Select]

/// <summary>Predefined AliceBlue color</summary>
public static readonly Color AliceBlue = new Color(240,248,255);

/// <summary>Predefined AntiqueWhite color</summary>
public static readonly Color AntiqueWhite = new Color(250,235,215);

/// <summary>Predefined Aqua color</summary>
public static readonly Color Aqua = new Color(0,255,255);

/// <summary>Predefined Aquamarine color</summary>
public static readonly Color Aquamarine = new Color(127,255,212);

/// <summary>Predefined Azure color</summary>
public static readonly Color Azure = new Color(240,255,255);

/// <summary>Predefined Beige color</summary>
public static readonly Color Beige = new Color(245,245,220);

/// <summary>Predefined Bisque color</summary>
public static readonly Color Bisque = new Color(255,228,196);

/// <summary>Predefined Black color</summary>
public static readonly Color Black = new Color(0,0,0);

/// <summary>Predefined BlanchedAlmond color</summary>
public static readonly Color BlanchedAlmond = new Color(255,235,205);

/// <summary>Predefined Blue color</summary>
public static readonly Color Blue = new Color(0,0,255);

/// <summary>Predefined BlueViolet color</summary>
public static readonly Color BlueViolet = new Color(138,43,226);

/// <summary>Predefined Brown color</summary>
public static readonly Color Brown = new Color(165,42,42);

/// <summary>Predefined BurlyWood color</summary>
public static readonly Color BurlyWood = new Color(222,184,135);

/// <summary>Predefined CadetBlue color</summary>
public static readonly Color CadetBlue = new Color(95,158,160);

/// <summary>Predefined Chartreuse color</summary>
public static readonly Color Chartreuse = new Color(127,255,0);

/// <summary>Predefined Chocolate color</summary>
public static readonly Color Chocolate = new Color(210,105,30);

/// <summary>Predefined Coral color</summary>
public static readonly Color Coral = new Color(255,127,80);

/// <summary>Predefined CornflowerBlue color</summary>
public static readonly Color CornflowerBlue = new Color(100,149,237);

/// <summary>Predefined Cornsilk color</summary>
public static readonly Color Cornsilk = new Color(255,248,220);

/// <summary>Predefined Crimson color</summary>
public static readonly Color Crimson = new Color(220,20,60);

/// <summary>Predefined Cyan color</summary>
public static readonly Color Cyan = new Color(0,255,255);

/// <summary>Predefined DarkBlue color</summary>
public static readonly Color DarkBlue = new Color(0,0,139);

/// <summary>Predefined DarkCyan color</summary>
public static readonly Color DarkCyan = new Color(0,139,139);

/// <summary>Predefined DarkGoldenrod color</summary>
public static readonly Color DarkGoldenrod = new Color(184,134,11);

/// <summary>Predefined DarkGray color</summary>
public static readonly Color DarkGray = new Color(169,169,169);

/// <summary>Predefined DarkGreen color</summary>
public static readonly Color DarkGreen = new Color(0,100,0);

/// <summary>Predefined DarkKhaki color</summary>
public static readonly Color DarkKhaki = new Color(189,183,107);

/// <summary>Predefined DarkMagenta color</summary>
public static readonly Color DarkMagenta = new Color(139,0,139);

/// <summary>Predefined DarkOliveGreen color</summary>
public static readonly Color DarkOliveGreen = new Color(85,107,47);

/// <summary>Predefined DarkOrange color</summary>
public static readonly Color DarkOrange = new Color(255,140,0);

/// <summary>Predefined DarkOrchid color</summary>
public static readonly Color DarkOrchid = new Color(153,50,204);

/// <summary>Predefined DarkRed color</summary>
public static readonly Color DarkRed = new Color(139,0,0);

/// <summary>Predefined DarkSalmon color</summary>
public static readonly Color DarkSalmon = new Color(233,150,122);

/// <summary>Predefined DarkSeaGreen color</summary>
public static readonly Color DarkSeaGreen = new Color(143,188,139);

/// <summary>Predefined DarkSlateBlue color</summary>
public static readonly Color DarkSlateBlue = new Color(72,61,139);

/// <summary>Predefined DarkSlateGray color</summary>
public static readonly Color DarkSlateGray = new Color(47,79,79);

/// <summary>Predefined DarkTurquoise color</summary>
public static readonly Color DarkTurquoise = new Color(0,206,209);

/// <summary>Predefined DarkViolet color</summary>
public static readonly Color DarkViolet = new Color(148,0,211);

/// <summary>Predefined DeepPink color</summary>
public static readonly Color DeepPink = new Color(255,20,147);

/// <summary>Predefined DeepSkyBlue color</summary>
public static readonly Color DeepSkyBlue = new Color(0,191,255);

/// <summary>Predefined DimGray color</summary>
public static readonly Color DimGray = new Color(105,105,105);

/// <summary>Predefined DodgerBlue color</summary>
public static readonly Color DodgerBlue = new Color(30,144,255);

/// <summary>Predefined Firebrick color</summary>
public static readonly Color Firebrick = new Color(178,34,34);

/// <summary>Predefined FloralWhite color</summary>
public static readonly Color FloralWhite = new Color(255,250,240);

/// <summary>Predefined ForestGreen color</summary>
public static readonly Color ForestGreen = new Color(34,139,34);

/// <summary>Predefined Fuchsia color</summary>
public static readonly Color Fuchsia = new Color(255,0,255);

/// <summary>Predefined Gainsboro color</summary>
public static readonly Color Gainsboro = new Color(220,220,220);

/// <summary>Predefined GhostWhite color</summary>
public static readonly Color GhostWhite = new Color(248,248,255);

/// <summary>Predefined Gold color</summary>
public static readonly Color Gold = new Color(255,215,0);

/// <summary>Predefined Goldenrod color</summary>
public static readonly Color Goldenrod = new Color(218,165,32);

/// <summary>Predefined Gray color</summary>
public static readonly Color Gray = new Color(128,128,128);

/// <summary>Predefined Green color</summary>
public static readonly Color Green = new Color(0,128,0);

/// <summary>Predefined GreenYellow color</summary>
public static readonly Color GreenYellow = new Color(173,255,47);

/// <summary>Predefined Honeydew color</summary>
public static readonly Color Honeydew = new Color(240,255,240);

/// <summary>Predefined HotPink color</summary>
public static readonly Color HotPink = new Color(255,105,180);

/// <summary>Predefined IndianRed color</summary>
public static readonly Color IndianRed = new Color(205,92,92);

/// <summary>Predefined Indigo color</summary>
public static readonly Color Indigo = new Color(75,0,130);

/// <summary>Predefined Ivory color</summary>
public static readonly Color Ivory = new Color(255,255,240);

/// <summary>Predefined Khaki color</summary>
public static readonly Color Khaki = new Color(240,230,140);

/// <summary>Predefined Lavender color</summary>
public static readonly Color Lavender = new Color(230,230,250);

/// <summary>Predefined LavenderBlush color</summary>
public static readonly Color LavenderBlush = new Color(255,240,245);

/// <summary>Predefined LawnGreen color</summary>
public static readonly Color LawnGreen = new Color(124,252,0);

/// <summary>Predefined LemonChiffon color</summary>
public static readonly Color LemonChiffon = new Color(255,250,205);

/// <summary>Predefined LightBlue color</summary>
public static readonly Color LightBlue = new Color(173,216,230);

/// <summary>Predefined LightCoral color</summary>
public static readonly Color LightCoral = new Color(240,128,128);

/// <summary>Predefined LightCyan color</summary>
public static readonly Color LightCyan = new Color(224,255,255);

/// <summary>Predefined LightGoldenrodYellow color</summary>
public static readonly Color LightGoldenrodYellow = new Color(250,250,210);

/// <summary>Predefined LightGray color</summary>
public static readonly Color LightGray = new Color(211,211,211);

/// <summary>Predefined LightGreen color</summary>
public static readonly Color LightGreen = new Color(144,238,144);

/// <summary>Predefined LightPink color</summary>
public static readonly Color LightPink = new Color(255,182,193);

/// <summary>Predefined LightSalmon color</summary>
public static readonly Color LightSalmon = new Color(255,160,122);

/// <summary>Predefined LightSeaGreen color</summary>
public static readonly Color LightSeaGreen = new Color(32,178,170);

/// <summary>Predefined LightSkyBlue color</summary>
public static readonly Color LightSkyBlue = new Color(135,206,250);

/// <summary>Predefined LightSlateGray color</summary>
public static readonly Color LightSlateGray = new Color(119,136,153);

/// <summary>Predefined LightSteelBlue color</summary>
public static readonly Color LightSteelBlue = new Color(176,196,222);

/// <summary>Predefined LightYellow color</summary>
public static readonly Color LightYellow = new Color(255,255,224);

/// <summary>Predefined Lime color</summary>
public static readonly Color Lime = new Color(0,255,0);

/// <summary>Predefined LimeGreen color</summary>
public static readonly Color LimeGreen = new Color(50,205,50);

/// <summary>Predefined Linen color</summary>
public static readonly Color Linen = new Color(250,240,230);

/// <summary>Predefined Magenta color</summary>
public static readonly Color Magenta = new Color(255,0,255);

/// <summary>Predefined Maroon color</summary>
public static readonly Color Maroon = new Color(128,0,0);

/// <summary>Predefined MediumAquamarine color</summary>
public static readonly Color MediumAquamarine = new Color(102,205,170);

/// <summary>Predefined MediumBlue color</summary>
public static readonly Color MediumBlue = new Color(0,0,205);

/// <summary>Predefined MediumOrchid color</summary>
public static readonly Color MediumOrchid = new Color(186,85,211);

/// <summary>Predefined MediumPurple color</summary>
public static readonly Color MediumPurple = new Color(147,112,219);

/// <summary>Predefined MediumSeaGreen color</summary>
public static readonly Color MediumSeaGreen = new Color(60,179,113);

/// <summary>Predefined MediumSlateBlue color</summary>
public static readonly Color MediumSlateBlue = new Color(123,104,238);

/// <summary>Predefined MediumSpringGreen color</summary>
public static readonly Color MediumSpringGreen = new Color(0,250,154);

/// <summary>Predefined MediumTurquoise color</summary>
public static readonly Color MediumTurquoise = new Color(72,209,204);

/// <summary>Predefined MediumVioletRed color</summary>
public static readonly Color MediumVioletRed = new Color(199,21,133);

/// <summary>Predefined MidnightBlue color</summary>
public static readonly Color MidnightBlue = new Color(25,25,112);

/// <summary>Predefined MintCream color</summary>
public static readonly Color MintCream = new Color(245,255,250);

/// <summary>Predefined MistyRose color</summary>
public static readonly Color MistyRose = new Color(255,228,225);

/// <summary>Predefined Moccasin color</summary>
public static readonly Color Moccasin = new Color(255,228,181);

/// <summary>Predefined NavajoWhite color</summary>
public static readonly Color NavajoWhite = new Color(255,222,173);

/// <summary>Predefined Navy color</summary>
public static readonly Color Navy = new Color(0,0,128);

/// <summary>Predefined OldLace color</summary>
public static readonly Color OldLace = new Color(253,245,230);

/// <summary>Predefined Olive color</summary>
public static readonly Color Olive = new Color(128,128,0);

/// <summary>Predefined OliveDrab color</summary>
public static readonly Color OliveDrab = new Color(107,142,35);

/// <summary>Predefined Orange color</summary>
public static readonly Color Orange = new Color(255,165,0);

/// <summary>Predefined OrangeRed color</summary>
public static readonly Color OrangeRed = new Color(255,69,0);

/// <summary>Predefined Orchid color</summary>
public static readonly Color Orchid = new Color(218,112,214);

/// <summary>Predefined PaleGoldenrod color</summary>
public static readonly Color PaleGoldenrod = new Color(238,232,170);

/// <summary>Predefined PaleGreen color</summary>
public static readonly Color PaleGreen = new Color(152,251,152);

/// <summary>Predefined PaleTurquoise color</summary>
public static readonly Color PaleTurquoise = new Color(175,238,238);

/// <summary>Predefined PaleVioletRed color</summary>
public static readonly Color PaleVioletRed = new Color(219,112,147);

/// <summary>Predefined PapayaWhip color</summary>
public static readonly Color PapayaWhip = new Color(255,239,213);

/// <summary>Predefined PeachPuff color</summary>
public static readonly Color PeachPuff = new Color(255,218,185);

/// <summary>Predefined Peru color</summary>
public static readonly Color Peru = new Color(205,133,63);

/// <summary>Predefined Pink color</summary>
public static readonly Color Pink = new Color(255,192,203);

/// <summary>Predefined Plum color</summary>
public static readonly Color Plum = new Color(221,160,221);

/// <summary>Predefined PowderBlue color</summary>
public static readonly Color PowderBlue = new Color(176,224,230);

/// <summary>Predefined Purple color</summary>
public static readonly Color Purple = new Color(128,0,128);

/// <summary>Predefined Red color</summary>
public static readonly Color Red = new Color(255,0,0);

/// <summary>Predefined RosyBrown color</summary>
public static readonly Color RosyBrown = new Color(188,143,143);

/// <summary>Predefined RoyalBlue color</summary>
public static readonly Color RoyalBlue = new Color(65,105,225);

/// <summary>Predefined SaddleBrown color</summary>
public static readonly Color SaddleBrown = new Color(139,69,19);

/// <summary>Predefined Salmon color</summary>
public static readonly Color Salmon = new Color(250,128,114);

/// <summary>Predefined SandyBrown color</summary>
public static readonly Color SandyBrown = new Color(244,164,96);

/// <summary>Predefined SeaGreen color</summary>
public static readonly Color SeaGreen = new Color(46,139,87);

/// <summary>Predefined SeaShell color</summary>
public static readonly Color SeaShell = new Color(255,245,238);

/// <summary>Predefined Sienna color</summary>
public static readonly Color Sienna = new Color(160,82,45);

/// <summary>Predefined Silver color</summary>
public static readonly Color Silver = new Color(192,192,192);

/// <summary>Predefined SkyBlue color</summary>
public static readonly Color SkyBlue = new Color(135,206,235);

/// <summary>Predefined SlateBlue color</summary>
public static readonly Color SlateBlue = new Color(106,90,205);

/// <summary>Predefined SlateGray color</summary>
public static readonly Color SlateGray = new Color(112,128,144);

/// <summary>Predefined Snow color</summary>
public static readonly Color Snow = new Color(255,250,250);

/// <summary>Predefined SpringGreen color</summary>
public static readonly Color SpringGreen = new Color(0,255,127);

/// <summary>Predefined SteelBlue color</summary>
public static readonly Color SteelBlue = new Color(70,130,180);

/// <summary>Predefined Tan color</summary>
public static readonly Color Tan = new Color(210,180,140);

/// <summary>Predefined Teal color</summary>
public static readonly Color Teal = new Color(0,128,128);

/// <summary>Predefined Thistle color</summary>
public static readonly Color Thistle = new Color(216,191,216);

/// <summary>Predefined Tomato color</summary>
public static readonly Color Tomato = new Color(255,99,71);

/// <summary>Predefined Transparent color</summary>
public static readonly Color Transparent = new Color(255,255,255);

/// <summary>Predefined Turquoise color</summary>
public static readonly Color Turquoise = new Color(64,224,208);

/// <summary>Predefined Violet color</summary>
public static readonly Color Violet = new Color(238,130,238);

/// <summary>Predefined Wheat color</summary>
public static readonly Color Wheat = new Color(245,222,179);

/// <summary>Predefined White color</summary>
public static readonly Color White = new Color(255,255,255);

/// <summary>Predefined WhiteSmoke color</summary>
public static readonly Color WhiteSmoke = new Color(245,245,245);

/// <summary>Predefined Yellow color</summary>
public static readonly Color Yellow = new Color(255,255,0);

/// <summary>Predefined YellowGreen color</summary>
public static readonly Color YellowGreen = new Color(154,205,50);


7
DotNet / [SFML 2.0] App. crash when using Image and quitting the app?
« on: July 08, 2011, 04:22:10 pm »
I copied your code into a new project and it runs fine here using VS 2010 x86 profile. (C# / SFML.NET 2.0)

Pages: [1]