public override void Create()
        {
            MyCamera             = new ObjectValue("Camera2D", typeof(Camera2DObject));
            MyCamera.ChangeEvent = SetCamera;
            GridSize             = new Vector2Value("Grid CellSize", new Vector2(32));
            UseGrid = new BoolValue("Use Grid");

#if EDITOR && WINDOWS
            if (ParentLevel.LevelForEditing)
            {
                UseGrid.ChangeEvent = SetUseGrid;
                UseGrid.Editable    = false;
            }
#endif

            MinBoundary = new Vector2Value("Boundary Min", new Vector2(-320), UpdateQuadGrid);
            MaxBoundary = new Vector2Value("Boundary Max", new Vector2(320), UpdateQuadGrid);
            Cells       = new Vector2Value("Cells", new Vector2(10), UpdateQuadGrid);
            UpdateQuadGrid();

            AddWindowForm(cameraControls = new CameraControls2D(this));
            AddWindowForm(objectControls = new ObjectControls2D(this));

            UpdateChildren = AddTag(GameObjectTag.Update);
            base.Create();
        }
示例#2
0
 public SpawnerFrame(Vector2Value Size, Vector2Value Position, FloatValue Rotation)
     : base(-1)
 {
     this.Size     = Size;
     this.Position = Position;
     this.Rotation = Rotation;
     InstanceManager.AddBasicChild(this);
 }
        public override void Create()
        {
#if EDITOR && WINDOWS
            this.AddRightClickEvent("Add Emitter", AddEmitter);
#endif
            Emitters = new ObjectListValue("Emitters", typeof(ParticleEmitter));
            MaxParticles = new IntValue("MaxParticles", 50, CreateArray);
            Additive = new BoolValue("Additive", true);
            UseDepth = new BoolValue("Use Depth", true);
            MinVelocity = new Vector2Value("Min Velocity");
            MaxVelocity = new Vector2Value("Max Velocity", Vector2.One);
            MyEffect = new EffectValue("Effect","ParticleEffect", EffectHolderType.Deferred3D);
            ParticleDuration = new FloatValue("ParticleDuration", 10);
            ParticleDuration.ChangeEvent = DurationChange;
            MaxParticles.ChangeEvent = MaxChange;
            MyEffect.ChangeEvent = EffectChange;
            CreateArray();

            AddTag(GameObjectTag._3DDepthOver);
            AddTag(GameObjectTag.Update);
            base.Create();
        }
示例#4
0
        public override void Create()
        {
            Position = new Vector2Value("Position", EditType.Average);

            Size     = new Vector2Value("Size", Vector2.One, EditType.Scalar);
            Rotation = new FloatValue("Angle", RotationChange);
            MoveValuetoFront(Position, Size, Rotation);


#if EDITOR && WINDOWS
            if (ParentScene != null && ParentScene.GetType().IsSubclassOf(typeof(Basic2DScene)))
            {
                Basic2DScene s = (Basic2DScene)ParentScene;
                if (s.GridSize != null)
                {
                    Size.set(s.GridSize.get());
                }
            }
#endif

            base.Create();
        }
 public static void DummyRead(byte ByteType, BinaryReader Reader)
 {
     switch (ByteType)
     {
         case 0: BoolValue.DummyRead(Reader); break;
         case 1: ColorValue.DummyRead(Reader); break;
         case 2: EffectValue.DummyRead(Reader); break;
         case 3: FloatValue.DummyRead(Reader); break;
         case 4: ModelValue.DummyRead(Reader); break;
         case 5: ObjectValue.DummyRead(Reader); break;
         case 6: SpriteFontValue.DummyRead(Reader); break;
         case 7: StringValue.DummyRead(Reader); break;
         case 8: Texture2DValue.DummyRead(Reader); break;
         case 9: TextureCubeValue.DummyRead(Reader); break;
         case 10: Vector2Value.DummyRead(Reader); break;
         case 11: Vector3Value.DummyRead(Reader); break;
         case 12: Vector4Value.DummyRead(Reader); break;
         case 13: ObjectListValue.DummyRead(Reader); break;
         case 14: IntValue.DummyRead(Reader); break;
         case 15: EventValue.DummyRead(Reader); break;
         case 16: TypeValue.DummyRead(Reader); break;
     }
 }
示例#6
0
 public static void DrawSprite(Texture2D tex, Vector2Value Position, Vector2Value Size, FloatValue Rotation, Color color)
 {
     DrawSprite(tex, Position.get(), Size.get(), Rotation.getAsRadians(), color);
 }