コード例 #1
0
 public BoardOption(PuzzleImage puzzleImage, bool previewHint, bool drawNum, DrawNumType drawNumType, Color fontColor, bool ignoreBoardType)
 {
     this.puzzleImage     = puzzleImage;
     this.previewHint     = previewHint;
     this.drawNum         = drawNum;
     this.drawNumType     = drawNumType;
     this.fontColor       = fontColor;
     this.ignoreBoardType = ignoreBoardType;
 }
コード例 #2
0
 /*
  * public BoardOption()
  * {
  *  this.puzzleImage.boardType = BoardType.Type5x5;
  *  this.puzzleImage.file = "img/Default/#PuzzleTitle#.jpg";
  *  this.puzzleImage.image = Image.FromFile(this.puzzleImage.file);
  *  this.puzzleImage.name = "Project Image";
  *  this.puzzleImage.desc = "한 껨 하셔야죠? ^-^)/";
  *  this.previewHint = true;
  *  this.drawNum = true;
  *  this.drawNumType = DrawNumType.Numeric;
  *  this.fontColor = Color.Black;
  *  this.ignoreBoardType = false;
  * }
  */
 public BoardOption(PuzzleImage puzzleImage)
 {
     this.puzzleImage     = puzzleImage;
     this.previewHint     = true;
     this.drawNum         = true;
     this.drawNumType     = DrawNumType.Numeric;
     this.fontColor       = Color.Black;
     this.ignoreBoardType = false;
 }
コード例 #3
0
    public PuzzleImageWindow(EventManager.Event e)
    {
        eventData = e;
        Game game = Game.Get();

        game.cc.panDisable = true;

        questPuzzle = e.qEvent as QuestData.Puzzle;

        if (game.quest.puzzle.ContainsKey(questPuzzle.sectionName))
        {
            puzzle        = game.quest.puzzle[questPuzzle.sectionName] as PuzzleImage;
            previousMoves = puzzle.moves;
        }
        else
        {
            puzzle = new PuzzleImage(questPuzzle.puzzleLevel, questPuzzle.puzzleAltLevel);
        }

        height = 19f / questPuzzle.puzzleAltLevel;
        width  = 19f / questPuzzle.puzzleLevel;

        Texture2D newTex = null;

        if (game.cd.puzzles.ContainsKey(questPuzzle.imageType))
        {
            newTex = ContentData.FileToTexture(game.cd.puzzles[questPuzzle.imageType].image);
        }
        else
        {
            newTex = ContentData.FileToTexture(System.IO.Path.GetDirectoryName(game.quest.qd.questPath) + "/" + questPuzzle.imageType);
        }
        if (newTex.width > newTex.height)
        {
            height = height * newTex.height / newTex.width;
        }
        else
        {
            width = width * newTex.width / newTex.height;
        }

        imageSprite = new Sprite[questPuzzle.puzzleLevel][];
        for (int i = 0; i < questPuzzle.puzzleLevel; i++)
        {
            imageSprite[i] = new Sprite[questPuzzle.puzzleAltLevel];
            for (int j = 0; j < questPuzzle.puzzleAltLevel; j++)
            {
                imageSprite[i][j] = Sprite.Create(newTex, new Rect(i * newTex.width / questPuzzle.puzzleLevel, (questPuzzle.puzzleAltLevel - (j + 1)) * newTex.height / questPuzzle.puzzleAltLevel, newTex.width / questPuzzle.puzzleLevel, newTex.height / questPuzzle.puzzleAltLevel), Vector2.zero, 1);
            }
        }

        CreateWindow();
    }