-
-
Notifications
You must be signed in to change notification settings - Fork 98
/
Copy pathGamePanel.cs
50 lines (41 loc) · 1.01 KB
/
GamePanel.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/* Generated by MyraPad at 14.12.2019 14:46:23 */
using Microsoft.Xna.Framework;
using Myra.Graphics2D.Brushes;
using Myra.Graphics2D.UI;
namespace Myra.Samples.DebugConsole
{
public partial class GamePanel
{
public GamePanel()
{
BuildUI();
_buttonDebugPanel.Click += _buttonDebugPanel_Click;
_buttonModalDebugPanel.Click += _buttonModalDebugPanel_Click;
}
private void ShowDebugPanel(bool isModal)
{
var debugPanel = new DebugPanel
{
Opacity = 0.75f,
Background = new SolidBrush(Color.Blue),
IsModal = isModal
};
_buttonDebugPanel.Enabled = false;
_buttonModalDebugPanel.Enabled = false;
debugPanel.Removed += (s, a) =>
{
_buttonDebugPanel.Enabled = true;
_buttonModalDebugPanel.Enabled = true;
};
Desktop.Widgets.Add(debugPanel);
}
private void _buttonDebugPanel_Click(object sender, System.EventArgs e)
{
ShowDebugPanel(false);
}
private void _buttonModalDebugPanel_Click(object sender, System.EventArgs e)
{
ShowDebugPanel(true);
}
}
}