protected override void OnStart() { Texture2D texture = Engine.Graphics.CreateTexture2D(CloudTexturePath); parent1 = new TextureObject2D() { Texture = texture, Position = new Vector2DF(0, 40), Color = new Color(0, 255, 0), }; parent2 = new TextureObject2D() { Texture = texture, Position = new Vector2DF(0, 80), Color = new Color(128, 128, 128), }; parent3 = new TextureObject2D() { Texture = texture, Position = new Vector2DF(0, 120), Color = new Color(128, 0, 0), }; child = new TextureObject2D() { Texture = texture, Position = new Vector2DF(450, 0), }; parent1.AddChild(child, ChildManagementMode.Nothing, ChildTransformingMode.Position); Engine.AddObject2D(parent1); Engine.AddObject2D(parent2); Engine.AddObject2D(parent3); Engine.AddObject2D(child); }
protected override void OnStart() { var layer = new Layer2D(); var obj1 = new TextureObject2D(); var obj2 = new TextureObject2D(); layer.AddObject(obj1); obj1.AddChild(obj2, ChildManagementMode.Nothing, ChildTransformingMode.All); Assert.AreEqual(layer, obj2.Layer); }
protected override void OnStart() { var scene = new Scene(); var layer = new ParentLayer(); var obj = new DisposingObject(layer); var obj1 = new TextureObject2D(); var obj2 = new TextureObject2D(); var obj3A = new TextureObject2D(); var obj3B = new TextureObject2D(); obj.AddChild(obj1, ChildManagementMode.RegistrationToLayer | ChildManagementMode.Disposal, ChildTransformingMode.Position); obj1.AddChild(obj2, ChildManagementMode.RegistrationToLayer | ChildManagementMode.Disposal, ChildTransformingMode.Position); obj2.AddChild(obj3A, ChildManagementMode.RegistrationToLayer | ChildManagementMode.Disposal, ChildTransformingMode.Position); obj2.AddChild(obj3B, ChildManagementMode.RegistrationToLayer | ChildManagementMode.Disposal, ChildTransformingMode.Position); scene.AddLayer(layer); layer.AddObject(obj); Engine.ChangeScene(scene); }
protected override void OnStart() { obj = new TextureObject2D() { Position = new Vector2DF(200, 200), Texture = Engine.Graphics.CreateTexture2D(CloudTexturePath), }; Engine.AddObject2D(obj); child = new TextureObject2D() { Position = new Vector2DF(10, 10), Texture = Engine.Graphics.CreateTexture2D(CloudTexturePath), }; obj.AddChild(child, ChildMode.Position); Engine.AddObject2D(child); coroutine = GetFlow(); }
protected override void OnStart() { var scene = new Scene(); var layer = new Layer2D(); var child = new TextureObject2D(); parent = new TextureObject2D(); parent.AddChild(child, ChildMode.All); layer.AddObject(parent); layer.AddObject(child); scene.AddLayer(layer); Engine.ChangeScene(scene); var texture = Engine.Graphics.CreateTexture2D(CloudTexturePath); parent.Position = new Vector2DF(320, 240); parent.CenterPosition = new Vector2DF(128, 128); parent.Texture = texture; child.Position = new Vector2DF(50, 50); child.Texture = texture; }