/// <summary> /// Initializes a new instance of the <see cref="GooglePlayGameHelper"/> class. /// </summary> /// <param name="activity">The activity.</param> /// <param name="adapter">The adapter.</param> public GooglePlayGameHelper(Activity activity, WaveEngine.Adapter.Adapter adapter) { this.adapter = adapter; this.activity = activity; this.GravityForPopups = GravityFlags.Top | GravityFlags.Center; this.adapter.OnActivityResult += this.OnGooglePlayPanelActivityResult; }
private void Form1_Load(object sender, EventArgs e) { Engine = new WaveEngine(); Engine.OnNewSimulationFrame += new WaveEngine.NewSimulationFrameHandler(Engine_OnNewSimulationFrame); Engine.Init(pb_image.Width / _resDiv, pb_image.Height / _resDiv); dcv = new DynamicColorVisualizer(); tsCbMouseAction.SelectedIndex = 0; tsCbMouseValue.SelectedIndex = 9; tsCbSimResolution.SelectedIndex = 3; if (_fileToLoad != "") { WaveSettings set = Engine.Settings; bool result = set.LoadFromFile(_fileToLoad); if (!result) { MessageBox.Show("An error occured whilst loading the file!", "Load"); return; } //Resize window int deltaWidth = this.Width - pb_image.Width; int deltaHeight = this.Height - pb_image.Height; Size windowS = new Size(set.Width * _resDiv + deltaWidth, set.Height * _resDiv + deltaHeight); this.Size = windowS; Engine.Settings = set; //MessageBox.Show("File loaded successfully!", "Load"); } String PersonalFolder = Environment.GetFolderPath(Environment.SpecialFolder.Personal); saveFileDialog.InitialDirectory = PersonalFolder + "\\WaveSim"; openFileDialog.InitialDirectory = PersonalFolder + "\\WaveSim"; Engine.Start(); }
/// <summary> /// Initializes the specified assets. /// </summary> /// <param name="assets">The assets.</param> public override void Initialize(WaveEngine.Framework.Services.AssetsContainer assets) { base.Initialize(assets); if (!string.IsNullOrEmpty(this.overlayTexturePath)) { this.overlayTexture = assets.LoadAsset<Texture2D>(this.overlayTexturePath); } }
/// <summary> /// Initializes the specified assets. /// </summary> /// <param name="assets">The assets.</param> public override void Initialize(WaveEngine.Framework.Services.AssetsContainer assets) { base.Initialize(assets); if (!string.IsNullOrEmpty(this.pathGrainTexture)) { this.grainTexture = assets.LoadAsset<Texture2D>(this.pathGrainTexture); } else { var assembly = this.GetType().GetTypeInfo().Assembly; var currentNamespace = assembly.GetName().Name; var textureResourcePath = currentNamespace + ".FilmGrain.NoiseEffectGrain.wpk"; var textureStream = ResourceLoader.GetEmbeddedResourceStream(assembly, textureResourcePath); this.grainTexture = assets.LoadAsset<Texture2D>(textureResourcePath, textureStream); } }
private void Collider_EndCollision(WaveEngine.Common.Physics2D.ICollisionInfo2D contact) { this.collisionCounter--; }
private void Collider_BeginCollision(WaveEngine.Common.Physics2D.ICollisionInfo2D contact) { this.collisionCounter++; this.soundManager.PlaySound(SoundType.Contact); }
private void OnScreenSizeChanged(object sender, WaveEngine.Common.Helpers.SizeEventArgs e) { this.RefreshCameraLimits(); }
/// <summary> /// Initializes the specified assets. /// </summary> /// <param name="assets">The assets.</param> public override void Initialize(WaveEngine.Framework.Services.AssetsContainer assets) { base.Initialize(assets); // LensColor var assembly = ReflectionHelper.GetMemberAssembly(this); var currentNamespace = assembly.GetName().Name; var textureResourcePath = currentNamespace + ".LensFlare.LensColor.wpk"; var textureStream = ResourceLoader.GetEmbeddedResourceStream(assembly, textureResourcePath); this.lensColorTexture = assets.LoadAsset<Texture2D>(textureResourcePath, textureStream); // LensDirt textureResourcePath = currentNamespace + ".LensFlare.LensDirt.wpk"; textureStream = ResourceLoader.GetEmbeddedResourceStream(assembly, textureResourcePath); this.lensDirtTexture = assets.LoadAsset<Texture2D>(textureResourcePath, textureStream); // LensStar textureResourcePath = currentNamespace + ".LensFlare.LensStar.wpk"; textureStream = ResourceLoader.GetEmbeddedResourceStream(assembly, textureResourcePath); this.lensStarTexture = assets.LoadAsset<Texture2D>(textureResourcePath, textureStream); }
/// <summary> /// Handles the Checked event of the checkbox5 control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="EventArgs" /> instance containing the event data.</param> void checkbox5_Checked(object sender, WaveEngine.Common.Helpers.BoolEventArgs e) { if (e.Value) { textblock1.Text = "CheckedCount: " + ++checkedCounter; } else { textblock2.Text = "UncheckedCount: " + ++uncheckedCounter; } }
public void explodeAnimation_OnKeyFrameEvent(object sender, WaveEngine.Common.Helpers.StringEventArgs e) { this.explosion.IsVisible = false; }
/// <summary> /// Initializes the specified assets. /// </summary> /// <param name="assets">The assets.</param> public override void Initialize(WaveEngine.Framework.Services.AssetsContainer assets) { base.Initialize(assets); this.LoadTexture(this.diffusePath, ref this.diffuse); this.LoadTexture(this.emissivePath, ref this.emissive); this.LoadTexture(this.normalPath, ref this.normal); this.LoadTexture(this.specularPath, ref this.specular); this.RefreshTexture(this.ambientPath, ref this.ambient); }
/// <summary> /// End collision world event /// </summary> /// <param name="contact">contact instance</param> private void Simulate2D_EndCollision(WaveEngine.Common.Physics2D.ICollisionInfo2D contact) { var fixtureA = contact.ColliderA; var fixtureB = contact.ColliderB; if (fixtureA.IsSensor && fixtureB.RigidBody.Type == RigidBodyType2D.Dynamic) { var tuple = this.fixturePairs.Find(pair => pair.Item1 == fixtureA && pair.Item2 == fixtureB); this.fixturePairs.Remove(tuple); } else if (fixtureB.IsSensor && fixtureA.RigidBody.Type == RigidBodyType2D.Dynamic) { var tuple = this.fixturePairs.Find(pair => pair.Item1 == fixtureB && pair.Item2 == fixtureA); this.fixturePairs.Remove(tuple); } }
/// <summary> /// Begin collision world event /// </summary> /// <param name="contact">contact instance</param> private void Simulate2D_BeginCollision(WaveEngine.Common.Physics2D.ICollisionInfo2D contact) { var fixtureA = contact.ColliderA; var fixtureB = contact.ColliderB; if (fixtureA.IsSensor && fixtureB.RigidBody.Type == WaveEngine.Common.Physics2D.RigidBodyType2D.Dynamic) { this.fixturePairs.Add(new Tuple<ICollider2D, ICollider2D>(fixtureA, fixtureB)); } else if (fixtureB.IsSensor && fixtureA.RigidBody.Type == RigidBodyType2D.Dynamic) { this.fixturePairs.Add(new Tuple<ICollider2D, ICollider2D>(fixtureB, fixtureA)); } }
/// <summary> /// Initializes the specified assets. /// </summary> /// <param name="assets">The assets.</param> public override void Initialize(WaveEngine.Framework.Services.AssetsContainer assets) { base.Initialize(assets); this.LoadTexture(this.texture1Path, ref this.texture1); this.LoadTexture(this.texture2Path, ref this.texture2); this.LoadTexture(this.normalPath, ref this.normal); }
/// <summary> /// Sets the profile. /// </summary> /// <param name="profile">The profile.</param> private void SetProfile(WaveEngine.Common.Media.DolbyProfiles profile) { this.enabled = true; WaveServices.MusicPlayer.DolbyProfile = profile; this.SetDolbyText(); }
/// <summary> /// Initializes the specified assets. /// </summary> /// <param name="assets">The assets.</param> public override void Initialize(WaveEngine.Framework.Services.AssetsContainer assets) { base.Initialize(assets); }
private void Collider_BeginCollision(WaveEngine.Common.Physics2D.ICollisionInfo2D contact) { var velocity = contact.ColliderB.RigidBody.LinearVelocity; float length = velocity.Length(); float volume = Math.Min(1, length / 5); var instance = this.soundManager.PlaySound(SoundType.CrateDrop, volume); }
/// <summary> /// Initializes the specified assets. /// </summary> /// <param name="assets">The assets.</param> public override void Initialize(WaveEngine.Framework.Services.AssetsContainer assets) { base.Initialize(assets); this.LoadTexture(this.diffusePath, ref this.diffuse); this.LoadTexture(this.normalPath, ref this.normal); if (!string.IsNullOrEmpty(this.environmentPath)) { this.RefreshTexture(this.environmentPath, ref this.environment); } }
private void OnScreenSizeChanged(object sender, WaveEngine.Common.Helpers.SizeEventArgs e) { this.Resize(); }