Closed Eraile closed 12 years ago
Great with Accelerometer handling. I will merge when you post it.
Regarding Skyboxes. In Unity it would be handled by setting the camera to clear to skybox. But that is not implemented in FFWD as we had no use for it. So the way to go would be to implement that.
Gestures should work. But you have to grab them directly with XNA. Be aware that you can only pull them once per frame, so check if they are pulled in Input. If they are, use them from there.
Hey mate, where can i send you the code package for the accelerometer?
If you can make a pull request via GitHub it will be easiest for me.
Hey mate, forgot to post it... :/ All parts of code with "// ERAILE" or something like this shoud be added.
[...]
using Microsoft.Xna.Framework.Input.Touch; using Microsoft.Devices.Sensors;
[...] namespace PressPlay.FFWD { public static class Input { // Eraile
public static Accelerometer _accelerometer;
public static Vector3 accelReading = new Vector3();
public static bool accelActive = false;
#endif
[...] internal static void Initialize() { _touches = new Touch[ApplicationSettings.DefaultCapacities.Touches];
/// ERAILE
TouchPanel.EnabledGestures = GestureType.Hold;
/// ERAILE
_accelerometer = new Accelerometer();
// Add the accelerometer event handler to the accelerometer sensor.
_accelerometer.CurrentValueChanged += accelerometer_CurrentValueChanged;
// Start the accelerometer
try
{
_accelerometer.Start();
accelActive = true;
}
catch (AccelerometerFailedException e)
{
// the accelerometer couldn't be started. No fun!
accelActive = false;
}
catch (UnauthorizedAccessException e)
{
// This exception is thrown in the emulator-which doesn't support an accelerometer.
accelActive = false;
}
[...]
public static void EndAccelerometer()
{
// ERAILE
// Stop the accelerometer if it's active.
if (Input.accelActive)
{
try
{
_accelerometer.Stop();
}
catch (AccelerometerFailedException e)
{
// the accelerometer couldn't be stopped now.
}
}
}
[...]
#if WINDOWS_PHONE
// ERAILE
public static void accelerometer_CurrentValueChanged(object sender, SensorReadingEventArgs<AccelerometerReading> e)
{
accelReading = e.SensorReading.Acceleration;
}
#endif
}
}
Hi Eraile, Could you please make these a real pull request so I can merge it easily?
Hi everyone, I've just began to try your toolset, and it's kinda cool! I've just added Accelerometer Handling, will post it soon :)
But, i've some problems which i'd need to get answers to ^^
Someone has maybe found something? PressPlay, just bought Tentacles to thank you too, it's a great game, hadn't time to play till now ^^ I hope i'll soon!