Date post: | 04-Jul-2015 |
Category: |
Technology |
Upload: | waveengineteam |
View: | 1,605 times |
Download: | 0 times |
WaveEngineTeam
@waveengineteam
http://waveengine.net
Wave Engine Services
¿What is a service?
• It does not depend on the scenes.
• It is accesible from anywhere in your code
• Multiplatform API
WaveEngine services list
• Assets
• CameraCapture
• GraphicsDevice
• Input
• Layout
• Microphone
• MusicPlayer
• Platform
• Random
• ScreenContextManager
• SoundPlayer
• Storage
• Taskscheduler
• TimerFactory
• TouchPanel
• VideoPlayer
• ViewportManager
WaveEngine services list
• Assets
• CameraCapture
• GraphicsDevice
• Input
• Layout
• Microphone
• MusicPlayer
• Platform
• Random
• ScreenContextManager
• SoundPlayer
• Storage
• Taskscheduler
• TimerFactory
• TouchPanel
• VideoPlayer
• ViewportManager
How to access?
WaveServices.[service]
Example:WaveServices.Input.KeyboardState.IsKeyPressed(Keys.Space);
WaveServices.Platform
WaveServices.Platform.PlatformName;
WaveServices.Platform.OperatingSystem;
WaveServices.Platform.AppVersion;
WaveServices.Platform.ScreenWidth;
WaveServices.Platform.ScreenHeight;
WaveServices.ViewportManager
Nokia Lumia 920768x1280
Samsung Galaxy S41080x1920
iPhone 51136x640
WaveServices.ViewportManager
Virtual mobile device
Myresolution
WaveServices.ViewportManager
Mode: Fill Mode: Uniform Mode: UniformToFill
There are 3 modes
WaveServices.ViewportManager
Configure ViewportManager
ViewportManager vm = WaveServices.ViewportManager;
vm.Activate(768, 1024, ViewportManager.StretchMode.UniformToFill);
WaveServices.ViewportManager
iPhone 51136x640
Surface RT1366x768
WaveServices.ScreenContextManager
ScreenContext
BackgroundScene
SceneUI
ScreenContext
Scene1
Simple context Multiple context
WaveServices.ScreenContextManager
ScreenContext1(Paused)
ScreenContext2(Running)
Stack(before)
PushScreenContext3
ScreenContext1(Paused)
ScreenContext2(Paused)
Stack(after)
ScreenContext3(Running)
WaveServices.ScreenContextManager
ScreenContext1(Paused)
ScreenContext2(Paused)
Stack(before)
Pop
ScreenContext1(Paused)
ScreenContext2(Running)
Stack(after)
ScreenContext3(Running)
WaveServices.ScreenContextManager
ScreenContext1(Paused)
ScreenContext2(Running)
Stack(before)
ToScreenContext3
Stack(after)
ScreenContext3(Running)
WaveServices.ScreenContextManager
ScreenContext(Running)(Drawing)
WaveServices.ScreenContextManager
Change the ScreenContext behavior
ScreenContext context = new ScreenContext();
context.Behavior =
ScreenContextBehaviors.DrawInBackground | ScreenContextBehaviors.UpdateInBackground;
ScreenContext2(Running)(Drawing)
Stack
WaveServices.ScreenContextManager
Screen Transitions
• ChecqueredAppearTransition• ColorFadeTransition• CombTransition• CoverTransition• CrossFadeTransition• CurtainsTransition• DoorwayTransition• FallingLinesTransition• FanTransitions
• PushTransition• RotateTransition• ScaleTransition• ShrinkAndSpinTransition• UncoverTransition• ZoomTransition
WaveServices.Input
Sensor’s list
• AccelerometerState• DisplayOrientationState• GamePadState• GyroscopeState• KeyboardState• MouseState• TouchPanelState
WaveServices.Input
var inputService = WaveServices.Input;
if (inputService.KeyboardState.IsConnected)
{
// Detect key Up
if (inputService.KeyboardState.Up == ButtonState.Pressed &&
beforeKeyboardState.Up != ButtonState.Pressed)
{
// Custom action
}
}
beforeKeyboardState = inputService.KeyboardState;
WaveServices.Input
var inputService = WaveServices.Input;
if (inputService.TouchPanelState.IsConnected)
{
// Detect touch
if (inputService. TouchPanelState.Count > 0)
{
Vector2 touchPosition = inputService. TouchPanelState[0].Position;
// Custom action
}
}
WaveServices.Input
var inputService = WaveServices.Input;
if (inputService.AccelerometerState.IsConnected)
{
inputService.StartAccelerometer();
inputService.AccelerometerState.SmoothAcceleration.X
inputService.AccelerometerState.SmoothAcceleration.Y
inputService.AccelerometerState.SmoothAcceleration.Z
}
…
inputService.StopAccelerometer();
WaveServices.TimerFactory
WaveServices.TimerFactory.CreateTimer(“myTimer”, TimeSpan.FromSeconds(0.6f), () =>
{
// Delayed action
},false);
WaveServices.MusicPlayer
var musicPlayer = WaveServices.MusicPlayer;
musicPlayer.Play(new MusicInfo(“Content/music.mp3”));
musicPlayer.IsRepeat = true;
musicPlayer.Volume = 0.5f;
WaveServices.SoundPlayer
//Register bank
SoundBank bank = new SoundBank(Assets);
WaveServices.SoundPlayer.RegisterSoundBank(bank);
//Register sounds
SoundInfo sound1 = new SoundInfo("Content/effect.wpk");
bank.Add(sound1);
WaveServices.SoundPlayer.Play(sound1);
WaveServices.Storage
public class MyStorageClass
{
public int Level;
public int BestScore;
public Vector2 PlayerPosition;
public float PlayerLife;
}
WaveServices.Storage
MyStorageClass storage;
…
WaveServices.Storage.Write<MyStorageClass>(storage);
…
if (WaveServices.Storage.Exists<MyStorageClass>())
{
storage = WaveServices.Storage.Read<MyStorageClass>();
}
Thank you
WaveEngine Team
@waveengineteam
http://waveengine.net