New answers tagged

0

For all intents and purposes what you have is essentially the Observer pattern in that you have an input class that maintains a list of callbacks or input handling objects. Other objects can then register with the input system to be notified when certain things happen(in this case when each key has been pressed). I might extend this system to allow users ...


0

So I've experimented with Petri Laarne's answer from StackOverflow and finally come up with a workable code (most examples online are using C#, and doesn't explain the entire process). Trying to explain it here: In Public Class Game1: Private WithEvents graphics As GraphicsDeviceManager Private WithEvents spriteBatch, spriteBatch2 As SpriteBatch In ...


1

SpeedOfSound is the value for the speed of sound... that is, how fast sound waves propagate. It does not control the playback speed (or thus, effective duration) of an individual sound. Instead, it alters how the Doppler effect of 3D sounds is perceived. What you probably want is to change the sound's Pitch property, although this has a limited range. XNA ...


0

To create this effect convert the pixel to greyscale: float grayscale = dot(color.rgb, float3(0.3, 0.59, 0.11)); Then return red above the threshold and return black below it (while preserving the alpha). See what threshold value works for you.


1

I can't give you exact implementation details for XNA, but the general idea is to completely forget the "fullscreen mode" - it is old and outdated, and at least Windows will not perform any faster with it, as Winodws changed to a DirectX desktop with Vista (or was it Win7?). Instead, you create an "extended desktop", ie. right-click at desktop / select ...


0

On a thumbstick Y positive 1 means "up": if (GamePad.GetState( PlayerIndex.One ).ThumbSticks.Left.Y == 1.0f) { // Player one has pressed the left thumbstick up. } See Documentation for thumbstick on MSDN (note Monogame is a implementation of XNA): Each of the thumbstick axis members is a signed value describing the position of the thumbstick. A value ...


0

Screen coordinates differ from thumbstick direction and other vector types in that Y increases down. In your case, negating the GamePad Y value makes it match the screen coordinate system. (In a 3D project the projection matrix would fix it.)


0

Fixed after updating MonoGame to 3.5 and .NET to 4.5. Apparently it was a MonoGame 3.4 issue that was causing the problem. It's a pity though, because that means I can't support Windows XP users anymore.


1

This is an issue with any non 1x1 filter(such as a Gaussian one). If you don't want to clip, you can not apply the filter on the edge, or apply only part of it(and it will be darker probably). Another option, if the background outside the image, is known to be a specific color or transparency, is when you apply the filter, apply that color as part of the ...


0

I think I've seen some of your other posts as I followed the same tutorial myself here years later. You've tried to "correct" the logic of the original algorithm by using //Find which axis has the biggest penetration ;D Vector2 fixnormal; if (xExtent > yExtent){ But that's not the original tutorial's logic ...


0

You can, however, you must use proper Devkit, which is hard but not impossible. Just, apply for ID@XBOX and go learn it yourself. And seriously, target steam first and show some traction. Or, pay a lot of bucks. Or, port to C# and go for it.


0

Have you considered trying to implement WPF instead of Winforms? I've not personally attempted to get either Monogame or XNA working with WPF, but it does seem to be doable: https://blogs.msdn.microsoft.com/nicgrave/2010/07/25/rendering-with-xna-framework-4-0-inside-of-a-wpf-application/ WPF is a good deal better than Winforms in a lot of cases, especially ...


0

You were adding Assets.GameArt.shadowTexture as Texture2D to your graphicdevice but there are no any texture associated in your HLSL file. You need add Texture2D to your pixel shader file and use your sampler to sample your texture2D. I suggest to render it without spritebatch and go one level lower and create your own quad with vertices, then render it with ...


2

It turns out that this is due to optimisation of the .fx compiler. When only one sampler is actually used (regardless of the number of samplers being declared) the effect is compiled to be optimized to only read from the first register. So: With this declaration: sampler ScreenTextureSampler: register (s0) // This is the texture that SpriteBatch will try ...



Top 50 recent answers are included