예제 #1
0
        public OptionsWindow(MainWindow mainWindow)
        {
            InitializeComponent();

            m_mainWindow = mainWindow;
            toolTips.SetToolTip(textBoxTexturePath, "this should be the root texture directory in the game's resource path");
            textBoxTexturePath.Text = m_mainWindow.TextureDirectory;
        }
예제 #2
0
파일: Program.cs 프로젝트: John-Chan/crush
 static void Main()
 {
     Application.EnableVisualStyles();
     Application.SetCompatibleTextRenderingDefault(false);
     //Application.Run(new MainWindow());
     
     MainWindow mw = new MainWindow();
     mw.Show();
     while (mw.Visible)
     {
         Application.DoEvents();
         mw.DispatchDrawingEvents();
     }
 }
예제 #3
0
        public BrowseTexturesWindow(MainWindow mainWindow)
        {
            InitializeComponent();

            m_mainWindow = mainWindow;

            //create a tab page for each sheet and fill with images
            foreach (var sheet in mainWindow.SpriteSheets)
            {
                TabPage tp = new TabPage(sheet.meta.image);
                tp.Size = tabControl1.Size;

                FlowLayoutPanel flp = new FlowLayoutPanel();
                flp.AutoScroll = true;
                flp.FlowDirection = FlowDirection.LeftToRight;
                flp.WrapContents = true;
                flp.Size = tp.Size;

                tp.Controls.Add(flp);
                foreach(Atlas.Frame frame in sheet.frames)
                {
                    PictureBox pb = new PictureBox();
                    pb.SizeMode = PictureBoxSizeMode.AutoSize;
                    pb.Image = frame.largeImage;
                    pb.Click += pb_Click;
                    pb.DoubleClick += pb_DoubleClick;
                    pb.Tag = frame;

                    if(frame == mainWindow.SelectedFrame)
                    {
                        pb.BackColor = Color.DodgerBlue;
                    }

                    flp.Controls.Add(pb);
                }
                tabControl1.TabPages.Add(tp);
            }

            foreach(TabPage tp in tabControl1.TabPages)
            {
                if(tp.Text == mainWindow.SelectedFrame.parentSheet.meta.image)
                {
                    tabControl1.SelectedTab = tp;
                    break;
                }
            }
        }