public void Yes() { ResetGame(); areYouSurePanel.gameObject.SetActive(false); PanelGame.SetActive(true); ActiveButtons(); }
public Window(Game game) { this.Game = game; InitializeComponent(); // Give the game panel borders PanelGame.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; // ..and THEN find out the resolution GameWidth = PanelGame.ClientSize.Width - 2; GameHeight = PanelGame.ClientSize.Height - 2; Console.WriteLine("{0} {1} {2} {3}", GameWidth, GameHeight, PanelGame.Width, PanelGame.Height); // Create buffered graphics bufferContext = BufferedGraphicsManager.Current; bufferGraphics = bufferContext.Allocate(PanelGame.CreateGraphics(), new System.Drawing.Rectangle(0, 0, GameWidth, GameHeight)); // Get a Graphics object this.Graphics = bufferGraphics.Graphics; this.panelGraphics = this.PanelGame.CreateGraphics(); SetStyle(ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint | ControlStyles.DoubleBuffer, true); }
public static void Initialize(PanelGame panelGame) { panelGame.DragDrop += OnDragDrop; panelGame.DragEnter += OnDragEnter; panelGame.DragLeave += OnDragLeave; panelGame.DragOver += OnDragOver; }
public void SelectManager(int s) { if (s == 0) { PanelGame.SetActive(false); } if (s == 1) // options { ButtonsManager.SetActive(false); Options.SetActive(true); Back.SetActive(true); } if (s == 2) // credits { ButtonsManager.SetActive(false); Credits.SetActive(true); Back.SetActive(true); } if (s == 3) { Options.SetActive(false); Credits.SetActive(false); ButtonsManager.SetActive(true); Back.SetActive(false); } }
// Use this for initialization IEnumerator Start() { root2D = UIRoot2D.Get(); panelGame = root2D.game; // 初期化 mainPanel.transform.localPosition = Vector3.zero; yield return(StartCoroutine(StartSequenceTitle())); state = State.Update; texLightMulti = panelGame.GetLightMulti(); texLightAdd = panelGame.GetLightAdd(); }
private void TmrCar_Tick(object sender, EventArgs e) { if (left) { area.X -= 5; } //move ship 5 to the left if (right) { area.X += 5; } // move ship 5 to the right if (up) { area.Y -= 5; } //move ship 5 to the up if (down) { area.Y += 5; } // move ship 5 to the down PanelGame.Invalidate(); }
public FormMain(PluginLoader pluginLoader) { InitializeComponent(); Width = UtinniCore.Utinni.utinni.GetConfig().GetInt("Editor", "width"); Height = UtinniCore.Utinni.utinni.GetConfig().GetInt("Editor", "height"); undoRedoManager = new UndoRedoManager(OnUpdateCommandsCallback, OnUndo, OnRedo); foreach (IPlugin plugin in pluginLoader.Plugins) { IEditorPlugin editorPlugin = (IEditorPlugin)plugin; if (editorPlugin != null) { editorPlugins.Add(editorPlugin); } } game = new PanelGame(pluginLoader); pnlGame.Controls.Add(game); pnlPlugins.BackColor = Colors.Primary(); pnlPlugins.ForeColor = Colors.Font(); tbddWindows = new UtinniTitlebarDropDownButton("Open..."); ToolStripDropDownItem tsddItem = new ToolStripMenuItem("Log"); tsddItem.Click += (sender, args) => { OpenLogWindow(); }; tbddWindows.Menu.Items.Add(tsddItem); CreatePluginControls(); tbbtnUndo = new UndoRedoTitlebarButton(this, "Undo", Resources.undo, undoRedoManager.Undo); tbbtnRedo = new UndoRedoTitlebarButton(this, "Redo", Resources.redo, undoRedoManager.Redo); tbbtnUndo.Click += TbbtnUndo_Click; tbbtnRedo.Click += TbbtnRedo_Click; LeftTitleBarButtons.Add(tbddWindows); LeftTitleBarButtons.Add(tbbtnUndo); LeftTitleBarButtons.Add(tbbtnRedo); formHotkeyManager.Add(new Hotkey("Undo", "Undo", "Control + Z", undoRedoManager.Undo, true)); formHotkeyManager.Add(new Hotkey("Redo", "Redo", "Control + Y", undoRedoManager.Redo, true)); formHotkeyManager.Add(new Hotkey("ToggleUI", "Toggle UI", "Shift + Oemtilde", ToggleFullWindowGame, true)); formHotkeyManager.CreateSettings(); formHotkeyManager.Load(); InitializeEditorCallbacks(); // Initialize callbacks that are purely editor related UtinniTitlebarButton tbbtnHotkeyEditor = new UtinniTitlebarButton("Hotkey Editor"); tbbtnHotkeyEditor.Click += (sender, args) => { FormHotkeyEditor form = new FormHotkeyEditor(formHotkeyManager, editorPlugins); form.Show(); }; RightTitleBarButtons.Add(tbbtnHotkeyEditor); if (UtinniCore.Utinni.utinni.GetConfig().GetBool("Editor", "autoOpenLogWindow")) { OpenLogWindow(); this.BringToFront(); this.Focus(); } }
public void No() { areYouSurePanel.gameObject.SetActive(false); PanelGame.SetActive(true); ActiveButtons(); }
public void AreYouSure() { PanelGame.SetActive(false); areYouSurePanel.gameObject.SetActive(true); DisableButtons(); }
private void Awake() { It = this; }
// Start is called before the first frame update void Awake() { instance = this; }
// Start is called before the first frame update void Start() { Instance = this; }
private void Form1_Load(object sender, EventArgs e) { GameGore = new Core(); GameGore.G = PanelGame.CreateGraphics(); }