Beispiel #1
0
        public override void Draw(Structures.EntityRenderProp properties)
        {
            DevicePanel d = properties.Graphics;

            Classes.Scene.EditorEntity entity = properties.EditorObject;
            int x            = properties.DrawX;
            int y            = properties.DrawY;
            int Transparency = properties.Transparency;

            bool fliph     = false;
            bool flipv     = false;
            int  aniID     = (int)entity.attributesMap["aniID"].ValueUInt8;
            int  attribute = (int)entity.attributesMap["attribute"].ValueUInt8;

            RSDKv5.Position parallaxFactor = entity.attributesMap["parallaxFactor"].ValueVector2;
            RSDKv5.Position loopPoint      = entity.attributesMap["loopPoint"].ValueVector2;

            if (ParallaxSpritePath == "")
            {
                ParallaxSpritePath = GetParallaxSpritePath();
            }

            if (Methods.Solution.SolutionState.Main.ShowParallaxSprites)
            {
                var editorAnim = LoadAnimation("EditorIcons2", d, 0, 12);
                DrawTexturePivotNormal(d, editorAnim, editorAnim.RequestedAnimID, editorAnim.RequestedFrameID, x, y, Transparency);
            }
            else
            {
                var editorAnim = LoadAnimation(ParallaxSpritePath, d, aniID, 0);
                DrawTexturePivotNormal(d, editorAnim, editorAnim.RequestedAnimID, editorAnim.RequestedFrameID, x, y, Transparency);
            }
        }
        /// <summary>
        /// Creates a new instance of the given SceneObject at the indicated position.
        /// </summary>
        /// <param name="sceneObject">Type of SceneObject to create an instance of.</param>
        /// <param name="position">Location to insert into the scene.</param>
        public void Add(RSDKv5.SceneObject sceneObject, RSDKv5.Position position)
        {
            var editorEntity = GenerateEditorEntity(new RSDKv5.SceneEntity(sceneObject, getFreeSlot(null)));

            editorEntity.Entity.Position = position;
            var newEntities = new List <EditorEntity> {
                editorEntity
            };

            LastAction = new Actions.ActionAddDeleteEntities(newEntities, true, x => AddEntities(x), x => DeleteEntities(x));
            AddEntities(newEntities);

            Deselect();
            editorEntity.Selected = true;
            selectedEntities.Add(editorEntity);
        }