private static Picture CreateANewDefaultImage(Vector2D position) { var material = ContentExtensions.CreateDefaultMaterial2D(); var newSprite = new Picture(new Theme(), material, Rectangle.FromCenter(position, new Size(0.05f))); newSprite.Set(BlendMode.Normal); return(newSprite); }
private void CreateDefaultMaterial() { if (service.Viewport != null) { service.Viewport.DestroyRenderedEntities(); //ncrunch: no coverage } Material material = ContentExtensions.CreateDefaultMaterial2D(); renderExample = new Sprite(material, new Rectangle(0.25f, 0.25f, 0.5f, 0.5f)); renderExample.IsActive = true; }
private static ParticleEmitterData CreateDefaultEmitterData() { return(new ParticleEmitterData { ParticleMaterial = ContentExtensions.CreateDefaultMaterial2D(), LifeTime = 1, Size = new RangeGraph <Size>(new Size(0.01f, 0.01f), new Size(0.1f, 0.1f)), SpawnInterval = 0.1f, MaximumNumberOfParticles = 128, StartVelocity = new RangeGraph <Vector3D>(new Vector3D(-0.1f, -0.2f, 0), new Vector3D(0.4f, -0.2f, 0)), Acceleration = new RangeGraph <Vector3D>(new Vector3D(0.0f, 0.1f, 0.0f), new Vector3D(0.0f, 0.3f, 0.0f)) }); }
private void CreateGeneralOutline(List <Entity2D> selectedControlList) { var boudingBox = CalculateBoundingBox(selectedControlList); GeneralOutline[0] = new Line2D(boudingBox.TopLeft, boudingBox.TopRight, SelectionColor); GeneralOutline[1] = new Line2D(boudingBox.TopLeft, boudingBox.BottomLeft, SelectionColor); GeneralOutline[2] = new Line2D(boudingBox.BottomLeft, boudingBox.BottomRight, SelectionColor); GeneralOutline[3] = new Line2D(boudingBox.TopRight, boudingBox.BottomRight, SelectionColor); Material material = ContentExtensions.CreateDefaultMaterial2D(Color.Blue); GizmoList[0] = new Sprite(material, new Rectangle(new Vector2D(boudingBox.TopRight.X - 0.02f, boudingBox.TopRight.Y), new Size(0.02f, 0.02f))); GizmoList[1] = new Sprite(material, new Rectangle( new Vector2D(boudingBox.BottomRight.X - 0.02f, boudingBox.BottomRight.Y - 0.02f), new Size(0.02f, 0.02f))); }
public void UpdateOnContentDeletion(string removedName) { if (EffectsInProject.Contains(removedName)) { EffectsInProject.Remove(removedName); } else if (EmittersInProject.Contains(removedName)) { EmittersInProject.Remove(removedName); } else if (MaterialList.Contains(removedName)) { MaterialList.Remove(removedName); foreach (var emitter in currentEffect.AttachedEmitters) { if (emitter.EmitterData.ParticleMaterial.Name.Equals(removedName)) { emitter.EmitterData.ParticleMaterial = ContentExtensions.CreateDefaultMaterial2D(); //ncrunch: no coverage } } } RaisePropertyChanged("EffectsInProject"); }
public void ShowDefaultMaterial2DWithCheckerColors() { Material defaultMaterial = ContentExtensions.CreateDefaultMaterial2D(); new Sprite(defaultMaterial, new Rectangle(0.25f, 0.25f, 0.5f, 0.5f)); }
public void ShowDefaultMaterial2DWithSolidColor() { Material defaultMaterial = ContentExtensions.CreateDefaultMaterial2D(Color.Blue); new Sprite(defaultMaterial, new Rectangle(0.25f, 0.25f, 0.5f, 0.5f)); }