public static void ActivateEditor() { editor_active = true; selectedPose = new Pose(); }
public void Imitate(Pose other) { sprites.Clear(); foreach(SEInfo s in other.sprites) { Add(s.x,s.y,s.scale,s.rot,s.r,s.g,s.b); } }
public void PoseSpriteElementTween(SpriteElement s, int spriteNum, float x, float y, float rot, Pose next, float ratio) { if (spriteNum >= sprites.Count) return; if (spriteNum >= next.sprites.Count) return; SEInfo spriteInfo = sprites[spriteNum]; SEInfo nextSpriteInfo = next.sprites[spriteNum]; if (ratio > 1.0f) ratio = 1.0f; if (ratio < 0.0f) ratio = 0.0f; s.pos.X = x + ((spriteInfo.x * (1f - ratio)) + (nextSpriteInfo.x * ratio)); s.pos.Y = y + ((spriteInfo.y * (1f - ratio)) + (nextSpriteInfo.y * ratio)); s.scale = ((spriteInfo.scale * (1f - ratio)) + (nextSpriteInfo.scale * ratio)); s.rotation = rot + ((spriteInfo.rot * (1f - ratio)) + (nextSpriteInfo.rot * ratio)); s.col = new Color(((spriteInfo.r * (1f - ratio)) + (nextSpriteInfo.r * ratio)), ((spriteInfo.g * (1f - ratio)) + (nextSpriteInfo.g * ratio)), ((spriteInfo.b * (1f - ratio)) + (nextSpriteInfo.b * ratio))); }
public static void SelectPoseToEdit(Pose target) { if (!editor_active) return; selectedPose.Imitate(target); editor_pose_loaded = true; }