本文整理汇总了C#中GUI类的典型用法代码示例。如果您正苦于以下问题:C# GUI类的具体用法?C# GUI怎么用?C# GUI使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GUI类属于命名空间,在下文中一共展示了GUI类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Main
public static void Main(string[] args)
{
Application.Init ();
GUI gui = new GUI ();
gui.Show ();
Application.Run ();
}
开发者ID:SnowFace,项目名称:Rechnerstrukturen,代码行数:7,代码来源:Main.cs
示例2: Add
public void Add(string name, GUI.WindowFunction f)
{
Tab t = new Tab ();
t.name = name;
t.f = f;
Add (t);
}
开发者ID:shinobushiva,项目名称:Takeakari-System,代码行数:7,代码来源:TabbedGUI.cs
示例3: GameUIManager
public GameUIManager()
{
UIMain uiMain = LKernel.GetG<UIMain>();
//This mess gets the height and width of the window for centering UI entities.
uint uheight, uwidth, colorDepth;
int height, width;
RenderWindow window = LKernel.GetG<RenderWindow>();
window.GetMetrics(out uwidth, out uheight, out colorDepth);
width = (int)uwidth;
height = (int)uheight;
inGameUI = uiMain.GetGUI("ingame gui");
itembox = inGameUI.GetControl<PictureBox>("itembox");
//itembox.Top = (height / 2);
//itembox.Bottom = (height / 2);
//itembox.Left = (width / 2);
//itembox.Right = (width / 2);
itemimage = inGameUI.GetControl<PictureBox>("itemimage");
//itemimage.Top = (height / 2);
//itemimage.Bottom = (height / 2);
//itemimage.Left = (width / 2);
//itemimage.Right = (width / 2);
}
开发者ID:CisciarpMaster,项目名称:PonyKart,代码行数:25,代码来源:GameUIManager.cs
示例4: Awake
// Use this for initialization
void Awake()
{
Instantiate(BackgroundPrefab, new Vector3(0, 0, 0), transform.rotation);
Instantiate(ClockwiseCog, new Vector3(1.28f, 0.218f, 0), transform.rotation);
Instantiate(ClockwiseCog, new Vector3(-0.925f, -0.073f, 0), transform.rotation);
Instantiate(CounterclockwiseCog, new Vector3(0.871f, 0.315f, 0), transform.rotation);
Instantiate(CounterclockwiseCog, new Vector3(-0.819f, 0.344f, 0), transform.rotation);
Instantiate(SmallPlatformPrefab, middlePlatformPosition, transform.rotation);
Instantiate(SmallPlatformPrefab, leftPlatformPosition, transform.rotation);
Instantiate(SmallPlatformPrefab, rightPlatformPosition, transform.rotation);
Instantiate(LargePlatformPrefab, basePlatformPosition, transform.rotation);
Instantiate(DeadlyFloorPrefab, deadlyFloorPosition, transform.rotation);
Instantiate(WallPrefab, leftFloorPosition, transform.rotation);
Instantiate(WallPrefab, rightFloorPosition, transform.rotation);
gui = ((Transform)Instantiate(GuiPrefab, transform.position, transform.rotation)).GetComponent<GUI>();
var playerOne = (Transform)Instantiate(NinjaPrefab, playerOneSpawningPoints[playerOneSpawningIndex], transform.rotation);
var playerTwo = (Transform)Instantiate(GuyPrefab, playerTwoSpawningPoints[playerTwoSpawningIndex], transform.rotation);
playerOneController = playerOne.GetComponent<PlayerController>();
playerTwoController = playerTwo.GetComponent<PlayerController>();
playerOneMeta = InitMeta(playerOne, "Ninja", PlayerID.P1);
playerTwoMeta = InitMeta(playerTwo, "Thug", PlayerID.P2);
}
开发者ID:tapanila,项目名称:WorkshopJam,代码行数:30,代码来源:Master.cs
示例5: Form_lireVariable
public Form_lireVariable(GUI parent, String nomVariable)
{
InitializeComponent();
this.leChoixEstFait = false;
this.parent = parent;
}
开发者ID:chamboug,项目名称:Projet_2A_Bee,代码行数:7,代码来源:Form_lireVariable.cs
示例6: preliminarySetup
public static void preliminarySetup(GUI gui)
{
PanelControls.setupFlag = true;
PlayerResources.gameState = new GameState(); //create brand new game
//populate button list
gui.buttonList = ButtonControls.populateButtons(gui);
//set status bar
gui.turnStatus.Text = "Turn: Player " + PlayerResources.gameState.currentPlayer;
PlayerResources.gameState.currentPlayer = 1;
//place players in corners
InitialSetups.placePlayersInCorners(gui);
ButtonControls.setCursorsForNextTurn(gui);
PanelControls.setupFlag = false; //declare end of setup
LoadSave.loadFlag = false; //declare end of game load
GamePlayerFunctions.availableAction = true;
//update player credits
//give all players an initial income of 2000 credits
PlayerResources.gameState.initialIncome(2000);
gui.creditsBox.Text = "" + PlayerResources.gameState.selectCurrentPlayer().goldCount;
gui.infoBox.Text = " Welcome. " + PlayerResources.gameState.player1.getName() + "'s \n turn.";
}
开发者ID:atadjiki,项目名称:Underworld2171,代码行数:27,代码来源:InitialSetups.cs
示例7: Start
// Use this for initialization
void Start()
{
Debug.Log("start scored");
SharedBehaviour.current.score = 115;
menu = GameObject.FindGameObjectWithTag("menuRoot").GetComponent<GUI>();
menu.state = "highscores";
}
开发者ID:jackgllghr,项目名称:EyeCandy,代码行数:8,代码来源:scored.cs
示例8: Main
static void Main(string[] args)
{
// initialize window and view
win = new RenderWindow(new VideoMode(1000, 700), "Hadoken!!!");
view = new View();
resetView();
gui = new GUI(win, view);
// exit Program, when window is being closed
//win.Closed += new EventHandler(closeWindow);
win.Closed += (sender, e) => { (sender as Window).Close(); };
// initialize GameState
handleNewGameState();
// initialize GameTime
GameTime gameTime = new GameTime();
gameTime.Start();
// debug Text
Text debugText = new Text("debug Text", new Font("Fonts/calibri.ttf"));
while (running && win.IsOpen())
{
KeyboardInputManager.update();
currentGameState = state.update();
// gather draw-stuff
win.Clear(new Color(100, 149, 237)); //cornflowerblue ftw!!! 1337
state.draw(win, view);
state.drawGUI(gui);
// first the state must be drawn, before I can change the currentState
if (currentGameState != prevGameState)
{
handleNewGameState();
}
// do the actual drawing
win.SetView(view);
win.Display();
// check for window-events. e.g. window closed
win.DispatchEvents();
// update GameTime
gameTime.Update();
float deltaTime = (float)gameTime.EllapsedTime.TotalSeconds;
// idleLoop for fixed FrameRate
float deltaPlusIdleTime = deltaTime;
while (deltaPlusIdleTime < (1F / fixedFps))
{
gameTime.Update();
deltaPlusIdleTime += (float)gameTime.EllapsedTime.TotalSeconds;
}
Console.WriteLine("real fps: " + (int)(1F / deltaPlusIdleTime) + ", theo fps: " + (int)(1F / deltaTime));
}
}
开发者ID:Greaka,项目名称:RuneShift,代码行数:60,代码来源:Program.cs
示例9: InvoiceControl
public InvoiceControl( Invoice invoice, House house, GUI gui )
{
this.invoice = invoice;
this.gui = gui;
this.house = house;
InitializeComponent();
}
开发者ID:EsleEnoemos,项目名称:HomeFinance,代码行数:7,代码来源:InvoiceControl.cs
示例10: PauseUIHandler
public PauseUIHandler()
{
pauseGui = LKernel.GetG<UIMain>().GetGUI("pause gui");
// hook up to the pause event
LKernel.GetG<Pauser>().PauseEvent += new PauseEvent(DoOnPause);
}
开发者ID:CisciarpMaster,项目名称:PonyKart,代码行数:7,代码来源:PauseUIHandler.cs
示例11: RaceResultUIHandler
public RaceResultUIHandler()
{
winnerGui = LKernel.Get<UIMain>().GetGUI("winner gui");
winnerLabel = winnerGui.GetControl<Label>("winner label");
LapCounter.OnFirstFinish += new RaceFinishEvent(OnFirstFinish);
winnerGui.Visible = false;
}
开发者ID:CisciarpMaster,项目名称:PonyKart,代码行数:7,代码来源:RaceResultUIHandler.cs
示例12: LoadingUIHandler
public LoadingUIHandler()
{
LevelManager.OnLevelPostLoad += OnLevelPostLoad;
LevelManager.OnLevelPreUnload += OnLevelPreUnload;
loadingGui = LKernel.GetG<UIMain>().GetGUI("loading screen gui");
}
开发者ID:CisciarpMaster,项目名称:PonyKart,代码行数:7,代码来源:LoadingUIHandler.cs
示例13: DrawResizeableWindow
public static Rect DrawResizeableWindow(Rect drawRect, int id, GUI.WindowFunction func)
{
Rect dragArea = new Rect(drawRect.x - 8, drawRect.y - 8, drawRect.width, drawRect.height);
int gid = EditorGUIUtility.GetControlID(FocusType.Native);
Event e = Event.current;
switch (e.GetTypeForControl(gid))
{
case EventType.MouseDown:
{
if (drawRect.Contains(e.mousePosition)) // inside this control
{
EditorGUIUtility.hotControl = gid;
Resizing = true;
e.Use();
Debug.Log("USED");
}
}
break;
case EventType.MouseUp:
{
Resizing = false;
e.Use();
}
break;
}
return drawRect;
//func.Invoke(id);
}
开发者ID:Aeal,项目名称:ULib,代码行数:33,代码来源:GUIWindow.cs
示例14: Start
// Use this for initialization
void Start()
{
hsTable = GameObject.FindGameObjectWithTag("highScoreText").GetComponent<GUIText>();
hsTable.text = "";
userInput = GameObject.FindGameObjectWithTag("userInput"); //.GetComponent<GUIText>()
menu = GameObject.FindGameObjectWithTag("menuRoot").GetComponent<GUI>() as GUI;
userPrompt = GameObject.FindGameObjectWithTag("userPrompt"); //.GetComponent<GUIText>();
// off at first
userPrompt.SetActive(false);
userInput.SetActive(false);
// get the data
var data = PlayerPrefs.GetString("HighScores");
if(!string.IsNullOrEmpty(data)) {
var b = new BinaryFormatter();
// create a new memory stream with the data
var m = new MemoryStream(Convert.FromBase64String(data));
highScores = (List<ScoreEntry>)b.Deserialize(m);
}else {
highScores.Add(new ScoreEntry{name = "SomePlayer",score = 10});
}
// sort the values we pulled from the player prefs
highScores = highScores.OrderByDescending(o=>o.score).ToList();
Debug.Log("scores in start: "+ highScores.Count());
}
开发者ID:jackgllghr,项目名称:EyeCandy,代码行数:28,代码来源:HighScores.cs
示例15: Game
// Constructor for Game
public Game()
{
board = new Board();
fileMonitor = new FileMonitor();
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
gui = new ChessForms.GUI(start, pauseUnpause, reset, saveGame, loadGame);
// Load last game
bool ok = SaveManager.loadCurrent(ref board);
if (ok)
{
// Set GUI and other stuff
gui.putString("Loading last game");
updateOnLoad();
}
else
{
reset();
}
gui.updateBoard(board);
Application.Run(gui);
}
开发者ID:smorkeks,项目名称:chessForms,代码行数:26,代码来源:Game.cs
示例16: DrawGUI
public void DrawGUI(GUI gui)
{
DisplayedInfo.DisplayedString = "Life: " + (int)Life;
gui.Draw(DisplayedInfo);
LifeBar.Scale = new Vector2(LifeBar.Scale.X, Life / MaxLife);
gui.Draw(LifeBar);
}
开发者ID:Greaka,项目名称:RuneShift,代码行数:7,代码来源:Player.cs
示例17: EnableControls
public static void EnableControls(GUI gui)
{
foreach (Control c in gui.Controls)
{
c.Enabled = true;
}
}
开发者ID:atadjiki,项目名称:Underworld2171,代码行数:7,代码来源:InterfaceControls.cs
示例18: MainMenuManager
public MainMenuManager()
{
LevelManager.OnLevelLoad += new LevelEvent(OnLevelLoad);
LevelManager.OnLevelPreUnload += new LevelEvent(OnLevelPreUnload);
UIMain uiMain = LKernel.GetG<UIMain>();
MenuBackgroundGui = uiMain.GetGUI("menu background gui");
GameTypeGui = uiMain.GetGUI("menu game type gui");
LevelSelectGui = uiMain.GetGUI("menu level select gui");
NetworkHostGui = uiMain.GetGUI("menu host info gui");
NetworkClientGui = uiMain.GetGUI("menu client info gui");
LobbyGui = uiMain.GetGUI("menu lobby gui");
CharacterSelectGui = uiMain.GetGUI("menu character select gui");
OptionsGui = uiMain.GetGUI("menu options gui");
// the checkers bit in the corner
PictureBox checkersPicture = MenuBackgroundGui.GetControl<PictureBox>("checkers picture");
checkersPicture.Bitmap = new Bitmap("media/gui/checkers.png");
// set up events and stuff
GameTypeGui.GetControl<Button>("game type single player button").MouseClick += (o, e) => Invoke(OnGameType_SelectSinglePlayer, o, e);
GameTypeGui.GetControl<Button>("game type networked host button").MouseClick += (o, e) => Invoke(OnGameType_SelectNetworkedHost, o, e);
GameTypeGui.GetControl<Button>("game type networked client button").MouseClick += (o, e) => Invoke(OnGameType_SelectNetworkedClient, o, e);
GameTypeGui.GetControl<Button>("game type options button").MouseClick += (o, e) => Invoke(OnGameType_SelectOptions, o, e);
GameTypeGui.GetControl<Button>("quit button").MouseClick += (o, e) => Launch.Quit = true;
NetworkHostPortTextBox = NetworkHostGui.GetControl<TextBox>("host info port text box");
NetworkHostPasswordTextBox = NetworkHostGui.GetControl<TextBox>("host info password text box");
NetworkHostGui.GetControl<Button>("host info next button").MouseClick += (o, e) => Invoke(OnHostInfo_SelectNext, o, e);
NetworkHostGui.GetControl<Button>("host info back button").MouseClick += (o, e) => Invoke(OnHostInfo_SelectBack, o, e);
NetworkClientIPTextBox = NetworkClientGui.GetControl<TextBox>("client info IP text box");
NetworkClientPortTextBox = NetworkClientGui.GetControl<TextBox>("client info port text box");
NetworkClientPasswordTextBox = NetworkClientGui.GetControl<TextBox>("client info password text box");
NetworkClientGui.GetControl<Button>("client info next button").MouseClick += (o, e) => Invoke(OnClientInfo_SelectNext, o, e);
NetworkClientGui.GetControl<Button>("client info back button").MouseClick += (o, e) => Invoke(OnClientInfo_SelectBack, o, e);
LobbyLabel = LobbyGui.GetControl<Label>("lobby label");
LobbyGui.GetControl<Button>("lobby next button").MouseClick += (o, e) => Invoke(OnLobby_SelectNext, o, e);
LobbyGui.GetControl<Button>("lobby back button").MouseClick += (o, e) => Invoke(OnLobby_SelectBack, o, e);
LevelSelectGui.GetControl<Button>("level select flat button").MouseClick += (o, e) => Invoke(OnLevelSelect, o, e, "flat");
LevelSelectGui.GetControl<Button>("level select testlevel button").MouseClick += (o, e) => Invoke(OnLevelSelect, o, e, "testlevel");
LevelSelectGui.GetControl<Button>("level select SAA button").MouseClick += (o, e) => Invoke(OnLevelSelect, o, e, "SweetAppleAcres");
LevelSelectGui.GetControl<Button>("level select WTW button").MouseClick += (o, e) => Invoke(OnLevelSelect, o, e, "WhitetailWoods");
LevelSelectGui.GetControl<Button>("level select TestAI button").MouseClick += (o, e) => Invoke(OnLevelSelect, o, e, "TestAI");
LevelSelectGui.GetControl<Button>("level select roulette button").MouseClick += (o, e) => Invoke(OnLevelSelect, o, e, "roulette");
LevelSelectGui.GetControl<Button>("level select back button").MouseClick += (o, e) => Invoke(OnLevelSelect_SelectBack, o, e);
CharacterSelectGui.GetControl<Button>("character select TS button").MouseClick += (o, e) => Invoke(OnCharacterSelect, o, e, "Twilight Sparkle");
CharacterSelectGui.GetControl<Button>("character select RD button").MouseClick += (o, e) => Invoke(OnCharacterSelect, o, e, "Rainbow Dash");
CharacterSelectGui.GetControl<Button>("character select AJ button").MouseClick += (o, e) => Invoke(OnCharacterSelect, o, e, "Applejack");
CharacterSelectGui.GetControl<Button>("character select PP button").MouseClick += (o, e) => Invoke(OnCharacterSelect, o, e, "Pinkie Pie");
CharacterSelectGui.GetControl<Button>("character select FS button").MouseClick += (o, e) => Invoke(OnCharacterSelect, o, e, "Fluttershy");
CharacterSelectGui.GetControl<Button>("character select rarity button").MouseClick += (o, e) => Invoke(OnCharacterSelect, o, e, "Rarity");
CharacterSelectGui.GetControl<Button>("character select back button").MouseClick += (o, e) => Invoke(OnCharacterSelect_SelectBack, o, e);
OptionsGui.GetControl<Button>("options ok button").MouseClick += (o, e) => Invoke(OnOptions_SelectOK, o, e);
}
开发者ID:CisciarpMaster,项目名称:PonyKart,代码行数:59,代码来源:MainMenuManager.cs
示例19: Algorithme2
public Algorithme2(GUI gui, BackgroundWorker backgroundWorker)
{
this.ligneCourante = 0;
this.listeDInstructions = new List<Instruction>();
this.listeDeVariables = new List<Variable>();
this.GUI = gui;
this.backgroundWorker = backgroundWorker;
}
开发者ID:chamboug,项目名称:Projet_2A_Bee,代码行数:8,代码来源:Algorithme.cs
示例20: LapCounterUIHandler
public LapCounterUIHandler()
{
lapCountGUI = LKernel.Get<UIMain>().GetGUI("lap count gui");
lapCountLabel = lapCountGUI.GetControl<Label>("lap count label");
LapCounter.OnLap += new LapCounterEvent(OnLap);
LevelManager.OnLevelPostLoad += new LevelEvent(OnPostLoad);
}
开发者ID:CisciarpMaster,项目名称:PonyKart,代码行数:8,代码来源:LapCounterUIHandler.cs
注:本文中的GUI类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论